Uploading compressed documents fail when compressed file contains special character
Uploading compressed files and uncompressing them fails when one of the contained files has a filename containing a special character.
[2019-08-11 19:00:59,385: ERROR/MainProcess] Task mayan.apps.sources.tasks.task_source_handle_upload[2c74c55d-38de-48bb-8523-bd1c2fc56bec] raised unexpected: UnicodeDecodeError('ascii', '02720000396882M20000_\x9bnderungderAGBf\x81rdieBen\x81tzungderUBSPrepaidkarten_20190514190002411045.pdf', 21, 22, 'ordinal not in range(128)')
Traceback (most recent call last):
File "/opt/mayan-edms/local/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "/opt/mayan-edms/local/lib/python2.7/site-packages/celery/app/trace.py", line 438, in __protected_call__
return self.run(*args, **kwargs)
File "/opt/mayan-edms/local/lib/python2.7/site-packages/mayan/apps/sources/tasks.py", line 104, in task_source_handle_upload
for compressed_file_child in compressed_file.get_members():
File "/opt/mayan-edms/local/lib/python2.7/site-packages/mayan/apps/common/compressed_files.py", line 67, in get_members
) for filename in self.members()
File "/opt/mayan-edms/local/lib/python2.7/site-packages/mayan/apps/common/compressed_files.py", line 140, in members
filename for filename in self._archive.namelist() if not filename.endswith('/')
UnicodeDecodeError: 'ascii' codec can't decode byte 0x9b in position 21: ordinal not in range(128)
Uncompressing them locally and then uploading the files works flawless.