dsoprea / PyEasyArchive

A very intuitive and useful adapter to libarchive for universal archive access.
MIT License
96 stars 33 forks source link

UnicodeDecodeError on files in archive if filename contains non unicode characters (ex: é à etc.) #51

Closed vchalmel closed 5 months ago

vchalmel commented 2 years ago

utf-8 encoding is hardcoded in this function of the source code making reading / extracting files with non utf-8 names impossible

def _archive_entry_pathname(entry):
    filepath = libarchive.calls.archive_entry.c_archive_entry_pathname(entry)
    if filepath is None:
        raise ValueError("Could not get entry file-path.")
    return filepath.decode('utf-8')