Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeEncodeError? #68

Open
FrancHR opened this issue Jan 28, 2023 · 1 comment
Open

UnicodeEncodeError? #68

FrancHR opened this issue Jan 28, 2023 · 1 comment
Labels
defect Something isn't working

Comments

@FrancHR
Copy link

FrancHR commented Jan 28, 2023

Last few days i have UnicodeEncodeError. Never had this before until now. There is no matter which code i have in py files. I also tried files which has successfully minified in the past, but now they have UnicodeEncodeError.
I had version 2.6.0, and today i have updated to 2.8.0 and i have the same error.

Python version 3.9 on Windows 11.

C:\Users\Zet>pyminify C:\Users\Zet\Desktop\work\wrapper.py --in-place

C:\Users\Zet\Desktop\work\wrapper.py
Traceback (most recent call last):
  File "C:\Users\Zet\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Zet\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Zet\AppData\Local\Programs\Python\Python39\Scripts\pyminify.exe\__main__.py", line 7, in <module>
  File "C:\Users\Zet\AppData\Local\Programs\Python\Python39\lib\site-packages\python_minifier\__main__.py", line 64, in main
    f.write(minified)
  File "C:\Users\Zet\AppData\Local\Programs\Python\Python39\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 1988-1994: character maps to <undefined>

Also, tried in python 3.11:

C:\Users\Zet>pyminify C:\Users\Zet\Desktop\work\main.py --in-place

C:\Users\Zet\Desktop\work\main.py
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Zet\AppData\Local\Programs\Python\Python311\Scripts\pyminify.exe\__main__.py", line 7, in <module>
  File "C:\Users\Zet\AppData\Local\Programs\Python\Python311\Lib\site-packages\python_minifier\__main__.py", line 64, in main
    f.write(minified)
  File "C:\Users\Zet\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode characters in position 28221-28227: character maps to <undefined>

On Ubuntu 20.04 and pyminfy v.2.8.0, with the same files everything is ok.

@dflook
Copy link
Owner

dflook commented Jan 28, 2023

This sounds related to #57

@dflook dflook added the defect Something isn't working label Sep 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants