question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

python3 unicode error

See original GitHub issue

Hi, 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:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
chriskiehlcommented, May 24, 2019

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!

0reactions
rgiannicocommented, May 21, 2019

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, to console=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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found