bczsalba / pytermgui

Python TUI framework with mouse support, modular widget system, customizable and rapid terminal markup language and more!
https://ptg.bczsalba.com
MIT License
2.21k stars 54 forks source link

[BUG] io.UnsupportedOperation error on launch #46

Closed x10102 closed 2 years ago

x10102 commented 2 years ago

Launching PTG on Windows produces an "io.UnsupportedOperation" error.

PTG Version: 4.3.1

Python version: 3.10

Code: Window using children as arguments example from README

Screenshot:

image

x10102 commented 2 years ago

This seems to be exactly the same error as #45. However, both the 'error.errno' and 'error.winerror' attributes are None. If the error number is always None on Windows, this could be fixed with a simple OS check:

...
except OSError as error:
            if error.errno != errno.EINVAL and os.name != 'nt':
                raise
...
bczsalba commented 2 years ago

Yup, I figured it was. Kind of annoying that the error gives completely different errors between Linux and Windows, while working without an exception on MacOS. Could you try the fix you have above?

x10102 commented 2 years ago

Just tried, it works.

bczsalba commented 2 years ago

Alright, will add it in the next release. It will either be a bugfix patch or come bundled with the next minor release, depending on how much time I have away from university over the weekend.

Thanks for the report!

x10102 commented 2 years ago

Nice. Thanks for the project btw, I love it.

bczsalba commented 2 years ago

Thank you! Btw, some very cool work is being done over at the compositor branch, which should massively improve drawing performance and general responsiveness.

Once that's done I'm planning on implementing a global color palette based on real life user testing. Exciting times!

bczsalba commented 2 years ago

Actually, while we are here, how is PTG working on Windows, and what is your specific config? Haven't really been able to test it over there yet, so I'm very interested in how things are.

x10102 commented 2 years ago

I haven't really gotten started with the project yet, but I'll be sure to update you if there are any other issues.