[issue5500] tarfile: path problem in arcname under windows

Elijah Merkin report at bugs.python.org
Tue Mar 17 16:36:02 CET 2009


New submission from Elijah Merkin <elm at transas.com>:

Tested on Python 2.5.4.

1. Use tarfile.open("fname", "w|gz") to create an archive.
2. Add a file using TarFile.add(name, arcname=None, recursive=True,
exclude=None) by specifying 2 params: absolute path to a source file as
'name' and something containing one or more directories, e.g.
'test/myfile.txt' as 'arcname'.
3. Close the archive.

On Linux file is added as 'test/myfile.txt'. On Windows the full path
specified as 'name' is used (e.g. 'D:\\MyDir\\myfile.txt'). When I use
'w|bz2' everything works correctly.

Probably this bug is somewhat similar to a bug #4750, though it happens
under Windows and doesn't happen under Linux.

----------
components: Library (Lib), Windows
messages: 83680
nosy: ellioh
severity: normal
status: open
title: tarfile: path problem in arcname under windows
type: behavior
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5500>
_______________________________________


More information about the Python-bugs-list mailing list