This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tarfile: dirsize is not zero
Type: Stage:
Components: Extension Modules Versions: Python 2.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: bertramscharpf, loewis
Priority: normal Keywords:

Created on 2004-09-20 11:10 by bertramscharpf, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg22499 - (view) Author: Bertram Scharpf (bertramscharpf) Date: 2004-09-20 11:10
Tarring a directory (only a directory, not its contents) 
with the tar program results in 
 
user@host:~$ mkdir tmp 
user@host:~$ tar --no-recursion -cf sample.tar tmp/ 
user@host:~$ tar tfv sample.tar  
drwxr-xr-x user/user 0 2004-09-20 12:55:27 tmp/ 
 
Using the Python `tarfile' module, the result is 
 
user@host:~$ python 
... 
>>> t = tarfile.open( 'sample.tar', 'w') 
>>> t.add( 'tmp', recursive = False) 
... 
user@host:~$ tar tfv sample.tar  
drwxr-xr-x user/user 4096 2004-09-20 12:55:27 tmp/ 
 
But there are no 4096 Bytes in the tar file. If this 
is not actually a bug, I would like to propose it to 
be one. 
 
I may provide a solution to this at 
<http://www.bertram-scharpf.de/tmp/tarfile.tar.gz> 
 
Bertram 
msg22500 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2004-09-21 19:03
Logged In: YES 
user_id=21627

This was fixed in tarfile.py 1.16
History
Date User Action Args
2022-04-11 14:56:07adminsetgithub: 40932
2004-09-20 11:10:51bertramscharpfcreate