Non-ASCII output hangs execution in PyInstaller packaged app
See original GitHub issue- [Windows 10] OS
- [3.7.3 ] Python Version
- [1.0.3] Gooey Version
- [3.5] PyInstaller
Hi, I’m having problem with running Gooey app packaged with PyInstaller. App prints some outputs to multi line textbox in “execution screen” but then hangs. App runs with no issues when running it non-packaged. I dug into it and appears the problem is with further printing to multi line box.
Traceback:
Exception in thread Thread-1:
Traceback (most recent call last):
File "threading.py", line 917, in _bootstrap_inner
File "threading.py", line 865, in run
File "lib\site-packages\gooey\gui\processor.py", line 71, in _forward_stdout
File "lib\site-packages\gooey\gui\processor.py", line 84, in _extract_progress
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 16: invalid continuation byte
Changing stdout
to the following fixed the problem:
utf8_stdout = os.fdopen(sys.stdout.fileno(), mode='w', encoding='utf-8', closefd=False)
sys.stdout = utf8_stdout
The issue seems to be related to this closed issue #230
Issue Analytics
- State:
- Created 4 years ago
- Comments:11
Top Results From Across the Web
Using Spec Files - PyInstaller
In the most simple case, set the current directory to the location of your program myscript.py and execute: pyinstaller myscript.py.
Read more >how can i convert my file to exe using pyinstaller
PyInstaller do not support non-ascii characters in paths and file names well, I personally avoid them. Then try to build exe. Share command...
Read more >PyInstaller Documentation - Read the Docs
Open a command prompt/shell window, and navigate to the directory where your .py file is located, then build your app with the following...
Read more >pyinstaller 3.1.1 - PyPI
It analyzes your code to discover every other module and library your script needs in order to execute. Then it collects copies of...
Read more >Using PyInstaller to Easily Distribute Python Applications
In this step-by-step tutorial, you'll learn how to use PyInstaller to turn your Python application into an executable with no dependencies or installation ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Following this great resource, it seems that using the
codecs
module to redirectstdout
andstderr
works.processor.py
If this works for you, that could be the solution.
https://github.com/chriskiehl/Gooey/issues/520#issuecomment-576155188
To build one file with
pyinstaller -F -w gui.py
, this is the only way to solve my problem, as I am using: [Windows 7] OS [3.8.6 ] Python Version [ 1.0.8.1] Gooey Version [ 4.7] PyInstaller VersionBTW, it should be
import locale