[issue31557] tarfile: incorrectly treats regular file as directory

2017-10-04 Thread Joe Tsai
Joe Tsai <joet...@google.com> 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". -- __

[issue31557] tarfile: incorrectly treats regular file as directory

2017-10-03 Thread Joe Tsai
Joe Tsai <joet...@google.com> 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 196

[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