python3 unicode error
See original GitHub issueHi, I’m running Windows 10 with a miniconda3 (python3) I installed gooey (v1.0.2) and pyinstaller (v3.4) today following the ‘packaging’ instructions here: https://chriskiehl.com/article/packaging-gooey-with-pyinstaller
I only changed this line to be added in my python script
from this nonbuffered_stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
to this nonbuffered_stdout = os.fdopen(sys.stdout.fileno(), 'w')
because of python3 needs (see this stackoverflow topic )
But I’ve got the following error.
> pip install Gooey
> pip install pyinstaller
> cd c:\mybuildingdir
> python test.py
# this runs successfully
> pyinstaller build.spec
69 INFO: PyInstaller: 3.4
69 INFO: Python: 3.7.3
71 INFO: Platform: Windows-10-10.0.17134-SP0
73 INFO: UPX is not available.
Traceback (most recent call last):
File "c:\users\giannico\appdata\local\continuum\miniconda3\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\giannico\appdata\local\continuum\miniconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\giannico\AppData\Local\Continuum\miniconda3\Scripts\pyinstaller.exe\__main__.py", line 9, in <module>
File "c:\users\giannico\appdata\local\continuum\miniconda3\lib\site-packages\PyInstaller\__main__.py", line 111, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\users\giannico\appdata\local\continuum\miniconda3\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\users\giannico\appdata\local\continuum\miniconda3\lib\site-packages\PyInstaller\building\build_main.py", line 838, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\users\giannico\appdata\local\continuum\miniconda3\lib\site-packages\PyInstaller\building\build_main.py", line 784, in build
exec(text, spec_namespace)
File "<string>", line 7
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
Any suggestion?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
"Unicode Error "unicodeescape" codec can't decode bytes ...
With Python 3 I had this problem: ... SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 25-26: truncated \UXXXXXXXX escape.
Read more >Working of Unicode Error in Python with Examples - eduCBA
When we use such a string as a parameter to any function, there is a possibility of the occurrence of an error. Such...
Read more >Python3UnicodeDecodeError - Python Wiki
Python3 does its best to give you texts encoded as a valid unicode characters strings. When it hits an invalid bytes sequence (according...
Read more >[Solved] Python SyntaxError: (unicode error) 'unicodeescape ...
The following error message is a common Python error, the “SyntaxError” represents a Python syntax error and the “unicodeescape” means that we ...
Read more >Processing Text Files in Python 3 - Nick Coghlan's Python Notes
UnicodeDecodeError may be thrown when reading such files (if the data is not actually in the specified encoding) · UnicodeEncodeError may be thrown...
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 Free
Top 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
You. Are. Amazing!
I’ve long been bugging people to add their packaging experiences / knowledge to the wiki. You are the first! Thanks for the wiki contribution!
Uh I solved the ‘Fatal Error Detected: Failed to execute script’ error too! Thanks to this issue here https://github.com/chriskiehl/Gooey/issues/295 I changed the build.spec file line
console=False,
toconsole=True,
and it works! I’ll add a step-by-step user guide to your wiki here: https://github.com/chriskiehl/Gooey/wiki/step-by-step-guide:-python3-gooey-and-pyinstaller I believe it could be useful to the community