[issue43098] tarfile list() method does not show file type

2021-12-07 Thread Val Shkolnikov


Val Shkolnikov  added the comment:

> contributions are only now accepted in form of github PRs
Done

--

___
Python tracker 
<https://bugs.python.org/issue43098>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue43098] tarfile list() method does not show file type

2021-02-01 Thread Val Shkolnikov


New submission from Val Shkolnikov :

The list() method of TarFile tarfile object shows question mark in place of 
file type in verbose mode. For instance
python3 -m tarfile -v -l my.tar
?rwxr-xr-x vals/users  0 2021-01-16 18:28:30 bin/
?rwxr-x--- vals/users266 2021-01-16 18:28:30 bin/backmine.sh
?rwxr-xr-x vals/users950 2018-01-02 10:39:18 bin/tm.sh
?rwxrwxrwx vals/users  0 2021-01-16 11:49:36 bin/source-highlight -> 
../source-highlight/bin/source-highlight
?rwxr-xr-x vals/users435 2011-03-27 15:38:06 bin/dd.sh

This is because the call stat.filemode(tarinfo.mode) does not pass tarinfo.type 
to stat.filemode. The type needs to be properly encoded and added to the 
argument.

My patch is attached. Verified under Linux, Cygwin and Windows.

--
files: patch
messages: 386129
nosy: val.shkolnikov
priority: normal
severity: normal
status: open
title: tarfile list() method does not show file type
type: behavior
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file49786/patch

___
Python tracker 
<https://bugs.python.org/issue43098>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com