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

python patool and too long names issue under windows? #171

Open
migube opened this issue Nov 10, 2024 · 7 comments
Open

python patool and too long names issue under windows? #171

migube opened this issue Nov 10, 2024 · 7 comments

Comments

@migube
Copy link

migube commented Nov 10, 2024

special characters like accents in folder names inside archive seems to give
patoolib.extract_archive(self.input_filename, outdir=extracted_dir, interactive=False)
...
Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\patoolib\programs\py_zipfile.py", line 51, in extract_zip
raise util.PatoolError(f"error extracting {archive}") from err

@wummel
Copy link
Owner

wummel commented Nov 10, 2024

What version of patool are you using? Try patool version 3.0.3 which fixes errors with special characters on windows systems.
And please post the complete error message using the "-v" verbose option.

@migube
Copy link
Author

migube commented Nov 11, 2024

hi
python.3.12_qbz5n2kfra8p0\localcache\local-packages\python312\site-packages (3.0.3)
let me see how to put verbose on python patool options :)

@migube
Copy link
Author

migube commented Nov 11, 2024

ok I played a bit changing the archive name to shorte name works, is it because total lenght of arch name, folder, file is too long?
tried verbosity=1 but not sure I see much more...

@migube migube changed the title python patool and utf8 inside ZIP file giving error python patool and too long names issue? Nov 11, 2024
@migube
Copy link
Author

migube commented Nov 13, 2024

ok so the same file in same folder does work on Linux, will try to move thhe file to c:\ see it if shortens... or other issue

@migube migube changed the title python patool and too long names issue? python patool and too long names issue under windows? Nov 14, 2024
@migube
Copy link
Author

migube commented Nov 18, 2024

actuually the error is displayed ....
FileNotFoundError: [WinError 206] The filename or extension is too long:

@wummel
Copy link
Owner

wummel commented Nov 18, 2024

This looks like a limitation of the zipfile module. Do you get the same error when installing 7-zip and using this instead of the python zipfile module?

@harkabeeparolus
Copy link

In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters.

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

No branches or pull requests

3 participants