ascoderu / xtarfile

Wrapper around tarfile to add support for more compression formats
Apache License 2.0
8 stars 5 forks source link

Error in extracting archive with nested folders #12

Open ronin1770 opened 2 years ago

ronin1770 commented 2 years ago

I am trying to extract from an archive that has nested folders. Structure is as follows:

meters --- 1 ------- 1.json --- 2 ------- 2.json .... .... ....

I am getting the following error:

Exception in extraction: [Errno 22] Invalid argument: '.\meters\128\2022-04-09T00:00:00.json'

Code used is as follows:

import xtarfile as tarfile try: with tarfile.open( tmp_folder + f.filename, 'r:gz') as archive: archive.extractall() except Exception as e: print(f"Exception in extraction: {e}") return "Error in extracting meters.tar.gz "

Python version is:

Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

c-w commented 2 years ago

Could you provide a sample archive binary file that I can use to reproduce this?

ronin1770 commented 2 years ago

Certainly. Find it attached

On Fri, 22 Apr 2022 at 18:38, Clemens Wolff @.***> wrote:

Could you provide a sample archive binary file that I can use to reproduce this?

— Reply to this email directly, view it on GitHub https://github.com/ascoderu/xtarfile/issues/12#issuecomment-1106525602, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF67FDA2DJPHPGSMTFKOAPLVGKTWBANCNFSM5TZK75LA . You are receiving this because you authored the thread.Message ID: @.***>

c-w commented 2 years ago

Hm, looks like replying via email and adding attachments doesn’t work. Could you upload it to Google Drive or similar and post a link?