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

Codespell fixes #10947

Merged
merged 2 commits into from
Oct 19, 2022
Merged

Codespell fixes #10947

merged 2 commits into from
Oct 19, 2022

Conversation

Holzhaus
Copy link
Member

@Holzhaus Holzhaus commented Oct 7, 2022

Attempt to solve #10946 by getting rid of the custom codespell wrapper, which not only makes pre-commit hard to use on windows, it's also broken (pre-commit run codespell --all-files does not work). Pre-commit failues are expected and should be ignored, because this touches a lot of files.

@JoergAtGithub please check if pre-commit run codespell --all-files works when you have this branch checked out.

@JoergAtGithub
Copy link
Member

Now the execution of codespell starts, but it seems codespell itself crashes:

PS C:\Users\Joerg.WORLDWARTWEB\source\repos\JoergAtGithub\mixxx> pre-commit run codespell --all-files
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/codespell-project/codespell.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-eslint.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-eslint:[email protected].
[INFO] Initializing environment for local.
[INFO] Initializing environment for https://github.com/psf/black.
[INFO] Initializing environment for https://gitlab.com/pycqa/flake8.
[INFO] Initializing environment for https://github.com/shellcheck-py/shellcheck-py.
[INFO] Initializing environment for https://github.com/DavidAnson/markdownlint-cli2.
[INFO] Initializing environment for https://github.com/sirosen/check-jsonschema.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-prettier:[email protected].
[INFO] Initializing environment for local:tinycss==0.4.
[INFO] Initializing environment for local:Markdown==3.3.4,beautifulsoup4==4.9.3,lxml==4.6.3.
[INFO] Installing environment for https://github.com/codespell-project/codespell.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
codespell................................................................Failed
- hook id: codespell
- exit code: 1

Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>
Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\Scripts\codespell.EXE\__main__.py", line 7, in <module>
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 748, in _script_main
    return main(*sys.argv[1:])
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 862, in main
    build_exclude_hashes(options.exclude_file, exclude_lines)
  File "C:\Users\Joerg.WORLDWARTWEB\.cache\pre-commit\reporvepfeq7\py_env-python3\lib\site-packages\codespell_lib\_codespell.py", line 444, in build_exclude_hashes
    for line in f:
  File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\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 0x81 in position 2244: character maps to <undefined>

@Holzhaus
Copy link
Member Author

Holzhaus commented Oct 8, 2022

Now that really is an upstream issue. We can update the codespell hook in .pre-commit-config.yaml to check if the issue is already fixed, but if not we should report it upstream at the codespell repo I guess.

@JoergAtGithub
Copy link
Member

This was easy to fix: codespell-project/codespell#2520

@Holzhaus
Copy link
Member Author

Holzhaus commented Oct 8, 2022

Ah, because Python's open uses the system encoding, and Windows localized in German uses cp1252 encoding by default?

@JoergAtGithub
Copy link
Member

I guess this is the case. I copied this line from another function in this file. This line was the only open statement which didn't specify the encoding.

Regarding this PR, I confirm, that it fixes codespell execution under Windows!

@JoergAtGithub
Copy link
Member

Codespell 2.2.2 is released, with my bugfix merged: https://github.com/codespell-project/codespell/releases/tag/v2.2.2

@Holzhaus
Copy link
Member Author

Codespell 2.2.2 is released, with my bugfix merged: https://github.com/codespell-project/codespell/releases/tag/v2.2.2

#10970

@Holzhaus
Copy link
Member Author

Holzhaus commented Oct 18, 2022

The pre-commit issue is expected because the spelling fixes touch a lot of files, including files that have formatting issues. Merge?

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, Thank you.
There are some more findings. But that does not matter.

@daschuer daschuer merged commit 1fe083b into mixxxdj:2.3 Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants