-
Notifications
You must be signed in to change notification settings - Fork 25
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
"OSError: [WinError 0] The operation completed successfully." (PyCharm, Windows) #48
Comments
Thanks for reporting! That are some other issues with the PYCharm console described in #32, but you shouldn't seeing this error. I'm wondering if there is another error and the value is being overwritten before it's read. As an experiment, can you modify line 86 of jinxed.win32? It looks like it's located at C:\Users\jschoena.conda\envs\main\lib\site-packages\jinxed\win32.py Try changing line 86 from
to
|
Wow, fast answer! :) I replaced it as you suggested, but it's the same outcome just that it raises on the I also printed the value of Edit: The function parameter |
It's strange behavior. The documentation for GetConsoleCP says a result of 0 is an error and And does everything work as expected outside of PyCharm? |
I added a Outside PyCharm, same venv, Anaconda Powershell Prompt:
Within general "Terminal" tab in PyCharm:
I also ran As a PyCharm run configuration with terminal emulation enabled, this script... import os
import enlighten
os.system("chcp")
enlighten_manager = enlighten.get_manager()
print("Doesn't arrive here!") ...results in:
|
It seems to be not just a PyCharm thing, but dependent also on the environment. If I try
My home PC is a Windows 10 Education, 21H2, 19044.1645. |
I'm wondering if it's a Pycharm bug or if there are any scripts running to initialize the environment that may be affecting this. Do you see anything in the config? To give some scoping, this is initiated by What I'm trying to decide is if this should be worked around by catching the Out of curiosity, what does |
Regarding
Summary: Consistent results:
Inconsistent results:
|
There are settings in PyCharm to config the console encoding, by default it's set to use System encoding: ... But actually, regardless what I set in here, the In contrary, the PyCharm built-in Terminal is using the system Powershell, and thus does return It's important to mind the terminology here: PyCharm has a built-in "Terminal" (= embedded Powershell) and a built-in "Python Console" (= ready loaded Python interpreter instance). |
(I updated some stuff in the previous messages - in case you read the content via e-mail, read it again on GitHub, please! ^^) |
So it seems PyCharm has some problems talking to the Windows Powershell 5.1.17763.2803 on Windows Server 2019 1809 (+ some other environment specs that may be involved, for example that I am using Windows Remote Desktop to connect to it). In effect, the usual methods ( I guess this is a PyCharm bug, because in the same Powershell outside PyCharm, it works. I'm thinking about filing a PyCharm bug report, if you agree with my thoughts. Anyway, there may be other editors/situation/cases like this where the codepage is not correctly reported? Maybe it's worth to make enlighten robustly work in such situations anyway, by uttering a warning or so and assuming some default encoding. (?) |
Thanks for all that investigation! Yes, it definitely seems like a PyCharm bug and it would be great if you file a bug with them. I think updating Jinxed to handle the error makes the most sense. Working on that now, but there seems to be a long queue for GH actions. |
I've filed a bug report for PyCharm: |
GitHub Actions have been stalled for the last day, but Appveyor tests and local tests pass, so I pushed a new Jinxed release. Upgrade to jinxed 1.2.0 and let me know if it works for you. |
With Jinxed 1.2.0 it works wonderfully! 😃 |
Good to hear! Thanks for reporting! |
Describe the bug
Hey, first, thanks a lot for enlighten, I love the ideas you have put into it! :)
I have the problem that a call to get_manager() will lead to the following error in my PyCharm console output WITH terminal emulation on Windows:
Even if I would catch the exception, the enlighten manager object is not created, thus I cannot continue from here.
To Reproduce
This snippet is enough:
Environment:
The text was updated successfully, but these errors were encountered: