-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
NullWriter has no attribute 'closed' #3503
Comments
Came across basically the same issue with
Honestly, I find the practice of overwriting pyinstaller/PyInstaller/loader/pyiboot01_bootstrap.py Lines 80 to 84 in 7b2b93a
quite questionable. The Python docs say that the two are "file objects" and "regular text files" (source), the APIs of which are defined in the io module (source). Replacing these objects with a class not derived from TextIOWrapper , TextIOBase or at least IOBase is a recipe for incompatibilities such as #1883 or the ones reported here.
Regarding the above workaround, I'd probably prefer a more focused approach using if not hasattr(sys.stdout, "closed"):
... |
I second that sentiment. Judging by the surrounding comments, this was added as a work-around for an issue from 15 years ago (http://bugs.python.org/issue1415), which has been addressed in python 3.0. So I think it is time to get rid of the |
This is similar to issue #1883
It is triggered when using the "click" library in a PyInstaller --noconsole application.
A workaround is as follows:
I suggest adding a class attribute, closed=False to fix this.
You may want to add the "errors" and "newlines" attributes as well, see the python docs.
The text was updated successfully, but these errors were encountered: