This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tarfile file names under win32
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: lars.gustaebel Nosy List: ggenellina, indi4source, lars.gustaebel
Priority: normal Keywords:

Created on 2007-03-22 07:12 by indi4source, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg31615 - (view) Author: ralf (indi4source) Date: 2007-03-22 07:12
the tarfile module uses normpath() to store the file name in the archive. Under win32 this results in pathes with backslashes and possible a leading "\". This confuses the  unix tar command.

I suppose the following commands instead of 
just normpath():
path = normpath (path)
path = path.replace ("\\", "/")
path = path.lstrip ("/")
msg31616 - (view) Author: Gabriel Genellina (ggenellina) Date: 2007-03-23 10:36
tarfile already attempts to manage backslashes well, using os.path.normpath(path).replace(os.sep, "/")
Can you provide a small script demonstrating the failure?
msg31617 - (view) Author: ralf (indi4source) Date: 2007-03-27 08:25
Sorry, I was using an derived class of TarFile and didn't realize that tarfile has defined its own
normpath() function.
When using tarfile.normpath() in my class it is working, too.
History
Date User Action Args
2022-04-11 14:56:23adminsetgithub: 44757
2007-03-22 07:12:43indi4sourcecreate