These are chat archives for cherrypy/cherrypy

27th
Sep 2018
Jeffrey R. Van Voorst
@jeffvanvoorst
Sep 27 2018 02:39
I am having an issue with respect to quotes in one of the source files. Tox fails the "Fix Double Quoted Strings" step. Not sure how to get my Anaconda3 or Windows Env to have Tox use a useful code page. I get the follow so I don't know the suggested fixes.
Traceback (most recent call last):
File "e:\anaconda3\Lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "e:\anaconda3\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Jeff.cache\pre-commit\repo3gu6joy0\py_env-default\Scripts\double-quote-string-fixer.exe__main__.py", line 9, in <module>
File "c:\users\jeff.cache\pre-commit\repo3gu6joy0\py_env-default\lib\site-packages\pre_commit_hooks\string_fixer.py", line 70, in main
return_value = fix_strings(filename)
File "c:\users\jeff.cache\pre-commit\repo3gu6joy0\py_env-default\lib\site-packages\pre_commit_hooks\string_fixer.py", line 35, in fix_strings
contents = io.open(filename).read()
File "c:\users\jeff.cache\pre-commit\repo3gu6joy0\py_env-default\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x90 in position 1790: character maps to <undefined>
I saw this, but I am less used to windows envs:
tox-dev/tox#254
Jeffrey R. Van Voorst
@jeffvanvoorst
Sep 27 2018 03:05
I think I got the quote issue resolved -- not sure how to fix the charmap or which byte in the test_https.py is messed up/not in the code page 1252.
Sviatoslav Sydorenko
@webknjaz
Sep 27 2018 07:14
Oh, it would've been so much easier under *NIX
It's not tox, but pre-commit's hook
I recall forcing UTF-8 encoding in CI somehow
Sviatoslav Sydorenko
@webknjaz
Sep 27 2018 08:05
Maybe set PYTHONIOENCODING=UTF-8 and
set PYTHONLEGACYWINDOWSIOENCODING=1`
Do you have win10 with Linux in it? It must be easier to just use that.
Jeffrey R. Van Voorst
@jeffvanvoorst
Sep 27 2018 11:28
I do have many other options. I can try Linux next time.