Skip to content

Error in extracting archive with nested folders #12

@ronin1770

Description

@ronin1770

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.

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