-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
Attempting to import the library within Windows EXE opened by double clicking, created by pyinstaller, I get the following:
Traceback (most recent call last):
File "tauon/t_modules/t_main.py", line 348, in <module>
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 384, in exec_module
File "colored_traceback/always/__init__.py", line 2, in <module>
File "colored_traceback/colored_traceback.py", line 78, in add_hook
File "colored_traceback/colored_traceback.py", line 64, in __init__
File "colored_traceback/colored_traceback.py", line 38, in _determine_formatter
File "colored_traceback/colored_traceback.py", line 34, in _get_term_color_support
_curses.error: lost sys.stdoutSeems to me this function could use a sys.platform check instead?
colored-traceback.py/colored_traceback/colored_traceback.py
Lines 28 to 35 in 98e6dea
| def _get_term_color_support(): | |
| try: | |
| import curses | |
| except ImportError: | |
| # Probably Windows, which doesn't have great curses support | |
| return 16 | |
| curses.setupterm() | |
| return curses.tigetnum('colors') |
The app in question is Tauon and current commits at the time - Taiko2k/Tauon@c2420e2 - has a prebuilt Windows binary with the issue.
I also previously managed to land on this but no clue how to repro at the moment, so that could just be some pyinstaller issue or an issue on my end:
(t_main.py:351)
Traceback (most recent call last):
File "C:/msys64/home/Yeet/Tauon/.venv/lib/python3.12/site-packages/tauon/t_modules/t_main.py", line 346, in <module>
import colored_traceback.always
File "C:/msys64/home/Yeet/Tauon/.venv/lib/python3.12/site-packages/colored_traceback/always/__init__.py", line 2, in <module>
add_hook(always=True)
File "C:/msys64/home/Yeet/Tauon/.venv/lib/python3.12/site-packages/colored_traceback/colored_traceback.py", line 78, in add_hook
colorizer = Colorizer(style, colors, debug)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:/msys64/home/Yeet/Tauon/.venv/lib/python3.12/site-packages/colored_traceback/colored_traceback.py", line 64, in __init__
self.formatter = _determine_formatter(style, colors, debug)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:/msys64/home/Yeet/Tauon/.venv/lib/python3.12/site-packages/colored_traceback/colored_traceback.py", line 38, in _determine_formatter
colors = colors or _get_term_color_support()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:/msys64/home/Yeet/Tauon/.venv/lib/python3.12/site-packages/colored_traceback/colored_traceback.py", line 34, in _get_term_color_support
curses.setupterm()
_curses.error: setupterm: could not find terminfo databaseReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels