patool icon indicating copy to clipboard operation
patool copied to clipboard

python patool and too long names issue under windows?

Open migube opened this issue 1 year ago • 8 comments

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

migube avatar Nov 10 '24 17:11 migube

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.

wummel avatar Nov 10 '24 19:11 wummel

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 avatar Nov 11 '24 07:11 migube

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 avatar Nov 11 '24 19:11 migube

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 avatar Nov 13 '24 21:11 migube

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

migube avatar Nov 18 '24 20:11 migube

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?

wummel avatar Nov 18 '24 22:11 wummel

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.

harkabeeparolus avatar Nov 22 '24 06:11 harkabeeparolus

tx it also explains that there is another way to increase? Feasible? tx

migube avatar Dec 28 '24 07:12 migube