Skip to content

error encoding chinese characters #135

@Yyeger

Description

@Yyeger

While using the tool on the OTA of the chinese version of colorOS (in my case oneplus ace 6t macan) it crashes on the last step, i suppose it's due to chinese characters in the name of some packages, it seems to have extracted everything correctly tho.

[INFO] Extracting my_manifest
[INFO] Extracting my_product
[INFO] Extracting my_region
[INFO] Extracting my_stock
[INFO] Step 4 - Finalizing
[INFO] Creating all_files.txt
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/yeger/.local/lib/python3.13/site-packages/dumpyara/__main__.py", line 11, in <module>
    main()
    ~~~~^^
  File "/home/yeger/.local/lib/python3.13/site-packages/dumpyara/main.py", line 46, in main
    output_path = dumpyara(args.file, output, args.debug)
  File "/home/yeger/.local/lib/python3.13/site-packages/dumpyara/dumpyara.py", line 71, in dumpyara
    (output_path / "all_files.txt").write_text(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    	"\n".join([str(file) for file in files_list]) + "\n"
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/lib64/python3.13/pathlib/_local.py", line 555, in write_text
    return PathBase.write_text(self, data, encoding, errors, newline)
           ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/pathlib/_abc.py", line 652, in write_text
    return f.write(data)
           ~~~~~~~^^^^^^
UnicodeEncodeError: 'ascii' codec can't encode characters in position 256625-256631: ordinal not in range(128)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions