[issue31557] tarfile: incorrectly treats regular file as directory

2017-10-04 Thread Joe Tsai
Joe Tsai added the comment: It creates a number of nested directories only because GNU (and BSD) tar implicitly create missing parent directories. If you cd into the bottom-most folder, you will see "foo.txt". -- ___ Python

[issue31557] tarfile: incorrectly treats regular file as directory

2017-10-04 Thread Nitish
Nitish added the comment: Try 'tar xvf test.tar'. On Linux machine at least, it is in fact producing a tree of directories. Not a single file. So - in a way what Python is reporting is correct. -- ___ Python tracker

[issue31557] tarfile: incorrectly treats regular file as directory

2017-10-03 Thread Joe Tsai
Joe Tsai added the comment: This bug is not platform specific. I've attached a reproduction: $ python >>> import tarfile >>> tarfile.open("test.tar", "r").next().isdir() True $ tar -tvf test.tar -rw-rw-r-- 0/0 0 1969-12-31 16:00

[issue31557] tarfile: incorrectly treats regular file as directory

2017-09-30 Thread Nitish
Nitish added the comment: > This check was the source of a bug that caused tarfile to report a regular as > a directory because the file path was extra long, and when the tar write > truncated the path to the first 100B, it so happened to end on a slash. AFAIK,

[issue31557] tarfile: incorrectly treats regular file as directory

2017-09-30 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- components: +Library (Lib) nosy: +serhiy.storchaka stage: -> needs patch type: -> behavior versions: +Python 2.7, Python 3.6, Python 3.7 ___ Python tracker

[issue31557] tarfile: incorrectly treats regular file as directory

2017-09-29 Thread Terry J. Reedy
Change by Terry J. Reedy : -- nosy: +lars.gustaebel ___ Python tracker ___ ___

[issue31557] tarfile: incorrectly treats regular file as directory

2017-09-22 Thread Joe Tsai
New submission from Joe Tsai: The original V7 header only allocates 100B to store the file path. If a path exceeds this length, then either the PAX format or GNU formats must be used, which can represent arbitrarily long file paths. When doing so, most tar writers just store the first 100B of