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

Error with the extract module when filenames have non-ascii characters #75

Closed
Augustin-FL opened this issue Feb 9, 2023 · 1 comment

Comments

@Augustin-FL
Copy link
Collaborator

Augustin-FL commented Feb 9, 2023

When trying to extract a .zip containing filenames with non-ascii characters, the extract module returns an error:

Traceback (most recent call last):
  File "/extract.py", line 31, in <module>
    with libarchive.public.file_reader(target, passphrases=password_candidates) as ar:
  File "/usr/local/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/usr/local/lib/python3.7/site-packages/libarchive/adapters/archive_read.py", line 295, in _enumerator
    opener(archive_res)
  File "/usr/local/lib/python3.7/site-packages/libarchive/adapters/archive_read.py", line 318, in opener
    _archive_read_open_filename(archive_res, filepath, block_size)
  File "/usr/local/lib/python3.7/site-packages/libarchive/adapters/archive_read.py", line 74, in _archive_read_open_filename
    filepath = filepath.encode(_ASCII_ENCODING)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 35: ordinal not in range(128)

The error seems to be caused by dsoprea/PyEasyArchive#52

@Augustin-FL Augustin-FL changed the title Error with the zip module when filenames have non-ascii characters Error with the extract module when filenames have non-ascii characters Feb 16, 2023
@Augustin-FL
Copy link
Collaborator Author

Fixed by 79d1211

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

Successfully merging a pull request may close this issue.

1 participant