-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Stdout hijacking in api.py is not thread safe #6125
Comments
This is a good catch. It may be a bit tricky to fix, but we’re open to PRs. There probably aren’t too many places where stdout or street are used, but passing something in may require a bunch of messy signature changes. |
It would be better to explicitly pass the stdout and stderr objects instead of modifying them in Here's a summary of what's involved for anybody interested in helping with this:
|
Overriding sys.stdout and sys.stderr in mypy.api is not threadsafe. This causes problems sometimes when using the api in pyls for example.
Erm... Well it seems Github happily shows any reference of an issue from any fork whatsoever... that's good to know. I wanted to wait for tomorrow so my colleague could test it on his setup since he was more "lucky" than me in getting the race conditions to "work" on his machine(tm). I guess nothing's wrong in putting the PR up for review now. |
@elkhadiy, take the time you need to make a good change set. Don't worry we won't jump on you :) |
Overriding sys.stdout and sys.stderr in mypy.api is not threadsafe. This causes problems sometimes when using the api in pyls for example.
Overriding sys.stdout and sys.stderr in mypy.api is not threadsafe. This causes problems sometimes when using the api in pyls for example.
Overriding sys.stdout and sys.stderr in mypy.api is not threadsafe. This causes problems sometimes when using the api in pyls for example.
What remains to be done about this issue? It causes a lot of problems on my setup (using pyls-mypy and spacemacs) and I'd be willing to do some work to fix it but the changes @elkhadiy made on their fork seem to already cover the needed changes. |
@AnOctopus I believe the fork was committed to but a PR was never opened. If you would like to fix this, please feel free to open a PR! (Or perhaps @elkhadiy is still interested?) |
Overriding sys.stdout and sys.stderr in mypy.api is not threadsafe. This causes problems sometimes when using the api in pyls for example.
PR #6750 opened. |
Overriding sys.stdout and sys.stderr in mypy.api is not threadsafe. This causes problems sometimes when using the api in pyls for example. This started with the changes made by @elkhadiy to fix python#6125. Fixes python#6125.
See tomv564/pyls-mypy#19, AFAIU mypy
api.py
relying onsys.stdout
overriding is not thread-safe and causes issues whensys.stout
andsys.stderr
are used concurrently.The text was updated successfully, but these errors were encountered: