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

sys.stdout.isatty() fails in function "set_msconsole()" in file "_console.py" #128

Open
hans-fritz-pommes opened this issue May 18, 2024 · 0 comments

Comments

@hans-fritz-pommes
Copy link

Traceback (most recent call last):  File "C:\Users\HansFritzPommes\Documents\app.py", line xy, in <module>
    from isbntools.app import meta
  File "C:\Users\HansFritzPommes\AppData\Local\Programs\Python\Python312\Lib\site-packages\isbntools\app.py", line 32, in <module>
    from ._initapp import config, registry, CONF_PATH, CACHE_FILE
  File "C:\Users\HansFritzPommes\AppData\Local\Programs\Python\Python312\Lib\site-packages\isbntools\_initapp.py", line 174, in <module>
    set_msconsole()
  File "C:\Users\HansFritzPommes\AppData\Local\Programs\Python\Python312\Lib\site-packages\isbntools\_console.py", line 108, in set_msconsole
    if not sys.stdout.isatty():
AttributeError: 'NoneType' object has no attribute 'isatty'

I get this error when I use a program using isbntools compiled with cx-freeze.
I think, this error happens because sys.stdout is None in this case, because I use a cx-freeze so called WIN32GUI application, which drops all requests to sys.stdout.
My recommendation:
in file "_console.py":
in function set_msconsole():

try:
    if not sys.stdout.isatty():
        return
except AttributeError:
    return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant