Skip to content

如何解决错误 UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 132: character maps to <undefined> decoding with 'windows-1251' codec failed #45

Description

@luckypoem

hi.
我运行python3 mvrk.py --config ./demo_src/config.py --source_dir ./demo_src/ --build_dir ./dist/ 后,显示:

Site prefix: /
Source dir: ./demo_src/
Build dir: ./dist/
Start clean...done.
Loading contents...
Traceback (most recent call last):
File "C:\Users\12799\maverick\Maverick\Utils.py", line 99, in safe_read
return f.read()
^^^^^^^^
File "", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe7 in position 131943: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\12799\maverick\mvrk.py", line 45, in
main()
File "C:\Users\12799\maverick\mvrk.py", line 41, in main
builder.build_all()
File "C:\Users\12799\maverick\Maverick\Builder.py", line 134, in build_all
content = Content(content_path)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\12799\maverick\Maverick\Content.py", line 30, in init
content = safe_read(path)
^^^^^^^^^^^^^^^
File "C:\Users\12799\maverick\Maverick\Utils.py", line 104, in safe_read
return content.decode(encoding=encoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\encodings\cp1251.py", line 15, in decode
return codecs.charmap_decode(input,errors,decoding_table)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 132: character maps to
decoding with 'windows-1251' codec failed

12799@DESKTOP-B6LK9IO MINGW64 ~/maverick$

谢谢回复!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions