-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Open
Labels
OS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
TarFile.extractall() does not perform path normalization before calling os.lstat(). This is an issue on Windows as the resulting path ends us using Windows-style (\\) and unix-style (/) path separators. This results in the following error: OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '\\\\?\\Z:\\extracted\\double-conversion-v3.1.4.tar.gz\\double-conversion-3.1.4/test/cctest'.
from Lib import tarfile
with tarfile.open(r'\\?\Z:\downloads\double-conversion-v3.1.4.tar.gz') as t:
t.extractall(r'\\?\Z:\extracted\double-conversion-v3.1.4.tar.gz')CPython versions tested on:
3.13, CPython main branch
Operating systems tested on:
Windows
Linked PRs
Metadata
Metadata
Assignees
Labels
OS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Projects
Status
No status