Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPython shell not starting in 5.0.6rc1 on Windows #2452

Closed
smk78 opened this issue Mar 7, 2023 · 7 comments
Closed

iPython shell not starting in 5.0.6rc1 on Windows #2452

smk78 opened this issue Mar 7, 2023 · 7 comments
Assignees
Labels
Defect Bug or undesirable behaviour

Comments

@smk78
Copy link
Contributor

smk78 commented Mar 7, 2023

Describe the bug
Trying too open the iPython shell in 5.0.6rc1 on W10/x64 this happened:

18:00:24 - ERROR: Traceback (most recent call last):
File "sas\qtgui\MainWindow\GuiManager.py", line 924, in actionPython_Shell_Editor
File "sas\qtgui\Utilities\IPythonWidget.py", line 36, in __init__
File "qtconsole\base_frontend_mixin.py", line 64, in kernel_client
File "qtconsole\jupyter_widget.py", line 327, in _started_channels
File "ipykernel\inprocess\client.py", line 159, in kernel_info
File "ipykernel\inprocess\client.py", line 194, in _dispatch_to_kernel
File "jupyter_core\utils\__init__.py", line 166, in wrapped
File "asyncio\base_events.py", line 616, in run_until_complete
File "ipykernel\kernelbase.py", line 421, in dispatch_shell
AttributeError: 'NoneType' object has no attribute 'flush'

And the shell never started.

To Reproduce
Install and run 5.0.6rc1
Tool > Python Shell/Editor

Expected behavior
The iPython shell should start normally.

SasView version (please complete the following information):

  • Version: 5.0.6rc1

Operating system (please complete the following information):

  • OS: W10/x64

Additional context
This is a change of behaviour since release 5.0.5 where the iPython shell starts normally.

@smk78
Copy link
Contributor Author

smk78 commented Mar 7, 2023

This issue has been added retrospectively. It is already under investigation by @rozyczko in branch https://github.com/SasView/sasview/tree/console_fix_5.0.6

@smk78 smk78 added the Defect Bug or undesirable behaviour label Mar 7, 2023
@rozyczko
Copy link
Member

Pinning dependencies to last working versions doesn't seem to solve the issue :( (at least not yet)
The failing line in IPykernel source is:

sys.stdout.flush()

with sys.stdout apparently being None.
Did we play with redirecting STDOUT maybe?

@smk78
Copy link
Contributor Author

smk78 commented Mar 13, 2023

@pkienzle has suggested changes to the windows console in #2280, but none of that is merged yet...

@butlerpd
Copy link
Member

I can confirm that this problem seems to exist also in main. As discussed this morning I used the opportunity to check while testing the corfunc PR on the grounds that that PR is uptodate with the main branch. I have not directly tested the main branch.

Regarding #2280 if that installer works with the console then it must be doing something that fixes the problem since it is based on main?

@rozyczko
Copy link
Member

sys.stdout (and stderr) are indeed None by the time the console is called.
What worse - the backup values in sys.__stdout__ are also nullified! Where is it coming from?

In my local develop version, those two are:

sys.stdout: <ipykernel.iostream.OutStream at 0x20f704c6340>
sys.__stdout__: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>

@rozyczko
Copy link
Member

Thist might be it.
ipython/ipykernel#795

@lucas-wilkins
Copy link
Contributor

@rozyczko Try their workarounds I guess?

@rozyczko rozyczko mentioned this issue Mar 15, 2023
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Bug or undesirable behaviour
Projects
None yet
Development

No branches or pull requests

5 participants