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

UnicodeDecodeError with ä and ö in comment #56

Closed
hugovk opened this issue Sep 17, 2014 · 1 comment
Closed

UnicodeDecodeError with ä and ö in comment #56

hugovk opened this issue Sep 17, 2014 · 1 comment

Comments

@hugovk
Copy link

hugovk commented Sep 17, 2014

Frosted doesn't like the ä and ö in this comment:

    # default palette taken from piffo 0.93 by Hans Häggström

For example:

C:\Temp>pip install -U frosted pyflakes
Requirement already up-to-date: frosted in c:\python27\lib\site-packages
Requirement already up-to-date: pyflakes in c:\python27\lib\site-packages
Cleaning up...

C:\Temp>wget https://raw.githubusercontent.com/python-pillow/Pillow/master/PIL/WalImageFile.py
--10:22:11--  https://raw.githubusercontent.com/python-pillow/Pillow/master/PIL/WalImageFile.py
           => `WalImageFile.py'
Resolving raw.githubusercontent.com... done.
Connecting to raw.githubusercontent.com[23.235.43.133]:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5,534 [text/plain]

100%[====================================>] 5,534          5.28M/s    ETA 00:00

10:22:11 (5.28 MB/s) - `WalImageFile.py' saved [5534/5534]


C:\Temp>pyflakes WalImageFile.py

C:\Temp>frosted WalImageFile.py
Traceback (most recent call last):
  File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "C:\Python27\lib\runpy.py", line 72, in _run_code
    exec code in run_globals
  File "C:\Python27\Scripts\frosted.exe\__main__.py", line 9, in <module>
  File "C:\Python27\lib\site-packages\frosted\main.py", line 43, in main
    warnings += check_path(file_path, directly_being_checked=len(file_names), **arguments)
  File "C:\Python27\lib\site-packages\frosted\api.py", line 133, in check_path
    return check(codestr, filename, reporter, settings_path, **setting_overrides)
  File "C:\Python27\lib\site-packages\frosted\api.py", line 114, in check
    w = checker.Checker(tree, filename, None, ignore_lines=_noqa_lines(codeString), **active_settings)
  File "C:\Python27\lib\site-packages\frosted\api.py", line 40, in _noqa_lines
    g = tokenize.generate_tokens(StringIO(str(codeString)).readline)   # tokenize the string
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe4 in position 1939: invalid continuation byte

C:\Temp>

After deleting the ä and ö from the file:

C:\Temp>frosted WalImageFile.py

C:\Temp>

This also causes a problem with Landscape reporting the Pillow project has no warnings when really it has plenty.

@carlio
Copy link

carlio commented Sep 19, 2014

I added some more information about this as part of #53: #53 (comment)

Essentially it doesn't like the implicit conversion from unicode to str done when concatenating the error message information.

@hugovk hugovk closed this as completed Mar 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants