-
Notifications
You must be signed in to change notification settings - Fork 10
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
BUG: OSError: Handle is invalid
during execution.
#271
Comments
Hi, I had the same problem and could work around it only by modifying the environment. I set pytask back to 0.0.14. Then everything worked again. |
Hi @vsondergeld, thank you for the confirmation and sorry for the inconvenience. v0.0.14 is pretty old. Which versions have you tested until you settled on this one? It could help me to track down the problem. |
Yeah I assumed it was the oldest one possible since it said one needs >= 0.0.14. I had tried setting <0.2 before which gave me 0.1.9, but that didnt work. So I just went for the oldest one for now and have not systematically tried out those between. If I do this in the next days, I will let you know. |
I tried to replicate the issue with an artificial and the project mentioned above. In a freshly set up environment, the issue does not occur anymore. Maybe a newer version of rich or some other dependency might have fixed the problem? Do you still experience the issue when you start with a new env, @vsondergeld? 🤞 |
I also have the same error occasionally (roughly every 15th-30th run).
Let me know if you need any further information. conda environment_r-mutex 1.0.1 anacondar_1 conda-forge |
Can you run python -m rich.diagnose as well? I am trying to get back to this issue after my vacation. |
Sure, See here
|
I still had no time to further look into this issue. Apologies! In the meantime, if you still experience this error, can you test this fix? Add these lines of code to some module that is imported somewhere in the beginning. For example, your project from pytask import console
console.legacy_windows = True |
Thanks! I tested the fix. Unfortunately, I still get the error every few runs. |
I get the error as well on my windows 11. I do not get it on my windows 10 computer. Suggested fixes do not work for me.
|
Can I ask you to list both environments and run |
|
You are probably not running your powershell within Windows Terminal, aren't you? Could you try it with Windows Terminal https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=de-de&gl=de? |
I ran it on cmd, but it does not make a difference (btw when I open windows terminal, it just opens a powershell tab, so not sure what this supposed to happen) |
Windows Terminal gives the shells run inside more color support, character support, etc.. I thought this might help. |
If someone could test this potential workaround, that would be awesome. Please, install rich=11.2 and try again. This is the last version without their win32 renderer released in v12 (https://github.com/Textualize/rich/releases/tag/v12.0.0). |
Thanks for the idea! I tried it out and unfortunately got the same error again :/ |
A student of mine has the same problem. If I understand previous posters correctly, it occurs randomly and not too often. For my student it occurs each and every time. We made sure that the project itself runs on other computers. We tried PowerShell and AnacondaPrompt. Here are some screenshots in case it helps: Output of Error message: |
I am sorry to hear that. What version of rich are you using? Is it Powershell 7 (blue) or Powershell Core? Have you tried running pwsh inside Terminal https://www.microsoft.com/store/apps/9n0dx20hk701? |
I know that we did not run it inside Terminal, but I can't answer the other questions. I'll inquire about the other things. |
I ran into the same issue when I used pytask for the first time today. For me the error occurs every time as well. I tried the fixes mentioned above but none of them worked for me. Error message(base) PS C:\Users\budde\testpr> pytask During handling of the above exception, another exception occurred: Traceback (most recent call last): And the rich.diagnose: |
Code Sample, a copy-pastable example
Problem description
I don't know how this error can be reproduced, but it occurred
pytask -v0
Work-around
Run pytask in the Windows Subsystem for Linux (WSL).
Reports
To collect information on this issue, please report the packages in your environment and run
python -m rich.diagnose
.The text was updated successfully, but these errors were encountered: