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

tarfile file names under win32 #44757

Closed
indi4source mannequin opened this issue Mar 22, 2007 · 3 comments
Closed

tarfile file names under win32 #44757

indi4source mannequin opened this issue Mar 22, 2007 · 3 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@indi4source
Copy link
Mannequin

indi4source mannequin commented Mar 22, 2007

BPO 1685773
Nosy @gustaebel

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/gustaebel'
closed_at = <Date 2007-03-27.08:25:01.000>
created_at = <Date 2007-03-22.07:12:43.000>
labels = ['library']
title = 'tarfile file names under win32'
updated_at = <Date 2007-03-27.08:25:01.000>
user = 'https://bugs.python.org/indi4source'

bugs.python.org fields:

activity = <Date 2007-03-27.08:25:01.000>
actor = 'indi4source'
assignee = 'lars.gustaebel'
closed = True
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2007-03-22.07:12:43.000>
creator = 'indi4source'
dependencies = []
files = []
hgrepos = []
issue_num = 1685773
keywords = []
message_count = 3.0
messages = ['31615', '31616', '31617']
nosy_count = 3.0
nosy_names = ['lars.gustaebel', 'ggenellina', 'indi4source']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue1685773'
versions = ['Python 2.5']

@indi4source
Copy link
Mannequin Author

indi4source mannequin commented Mar 22, 2007

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 ("/")

@indi4source indi4source mannequin closed this as completed Mar 22, 2007
@indi4source indi4source mannequin assigned gustaebel Mar 22, 2007
@indi4source indi4source mannequin added the stdlib Python modules in the Lib dir label Mar 22, 2007
@indi4source indi4source mannequin closed this as completed Mar 22, 2007
@indi4source indi4source mannequin assigned gustaebel Mar 22, 2007
@indi4source indi4source mannequin added the stdlib Python modules in the Lib dir label Mar 22, 2007
@ggenellina
Copy link
Mannequin

ggenellina mannequin commented Mar 23, 2007

tarfile already attempts to manage backslashes well, using os.path.normpath(path).replace(os.sep, "/")
Can you provide a small script demonstrating the failure?

@indi4source
Copy link
Mannequin Author

indi4source mannequin commented Mar 27, 2007

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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

0 participants