[issue9071] TarFile doesn't support member files with a leading ./

2010-06-29 Thread Gustavo Niemeyer

Gustavo Niemeyer gust...@niemeyer.net added the comment:

Indeed, nice use of the time machine! :-)

Thanks Lars!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9071] TarFile doesn't support member files with a leading ./

2010-06-25 Thread Lars Gustäbel

Lars Gustäbel l...@gustaebel.de added the comment:

This is a duplicate of issue6054 which has been fixed in Python 2.7 (r74571).

(Hi, Gustavo!)

--
assignee:  - lars.gustaebel
nosy: +lars.gustaebel
resolution:  - duplicate
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9071] TarFile doesn't support member files with a leading ./

2010-06-25 Thread Free Ekanayaka

Free Ekanayaka f...@64studio.com added the comment:

Thanks for the prompt reply! Cool to know this is already fixed.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9071] TarFile doesn't support member files with a leading ./

2010-06-24 Thread Free Ekanayaka

New submission from Free Ekanayaka f...@64studio.com:

The tar format allows to have memeber files whose path has a leading ./:

$ echo  foo
$ tar cf bar.tar ./foo
$ tar tf bar.tar 
./foo

However the tarfile module doesn't allow this:

 from StringIO import StringIO
 from tarfile import TarInfo, TarFile
 info = TarInfo(./foo)
 fd = open(bar.tar, w)
 tar = TarFile.open(fileobj=fd, mode=w)
 tar.addfile(info, )
 tar.close()

then:

$ tar tf bar.tar 
foo

So in practice the tarfile module forces the removal of leading ./'s.

In particular this is a problem when creating .deb files (dpkg) 
programmatically as these contains tar files with members with a leading ./.

--
components: Library (Lib)
messages: 108537
nosy: free.ekanayaka
priority: normal
severity: normal
status: open
title: TarFile doesn't support member files with a leading ./
type: behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9071] TarFile doesn't support member files with a leading ./

2010-06-24 Thread Gustavo Niemeyer

Gustavo Niemeyer gust...@niemeyer.net added the comment:

Please note that even if unpacking such a tar might be semantically equivalent 
to a version which strips out the ./ prefix, it should be possible to create 
a tar with valid path names such as these.

In the case of debs, for instance, the files inside the tarball may contain 
expected path names, which means that some (badly done, perhaps) tools could 
*expect* the file to be exactly that which is created by the standard tools 
(e.g. ./debian/control), and break down once it's not found.

With this in mind, it would indeed be nice to be able to use paths prefixed 
with ./ in Python's tarfile.

--
nosy: +niemeyer

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com