msg77485 - (view) |
Author: Horváth István Róbert (throbi) |
Date: 2008-12-10 07:11 |
tarfile does not set the creation date and time of the extracted directories, all extracted directories will get the date and time of the extraction, although in the source archive (created by tarfile) the creation date and time is stored for directories, too. |
|
|
msg77486 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2008-12-10 07:25 |
I cannot reproduce this; it works fine for me. Can you provide a test case? |
|
|
msg77487 - (view) |
Author: Horváth István Róbert (throbi) |
Date: 2008-12-10 07:50 |
Sure, see the attachment. Just call: python pack.py unpack directory.tar You should get the folder named "directory" dated to the current date and time. |
|
|
msg77488 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2008-12-10 08:05 |
I still cannot reproduce this: martin@mira:/tmp/h$ ls -l insgesamt 12 -rw-r--r-- 1 martin martin 172 10. Dez 08:40 directory.tar -rw-r--r-- 1 martin martin 1497 25. Feb 2008 pack.py -rw-r--r-- 1 martin martin 1129 10. Dez 08:58 testcase.zip martin@mira:/tmp/h$ date Mi 10. Dez 09:02:49 CET 2008 martin@mira:/tmp/h$ python pack.py unpack directory.tar Unpack done. martin@mira:/tmp/h$ ls -l insgesamt 16 drwxrwxrwx 2 martin martin 4096 10. Dez 08:38 directory -rw-r--r-- 1 martin martin 172 10. Dez 08:40 directory.tar -rw-r--r-- 1 martin martin 1497 25. Feb 2008 pack.py -rw-r--r-- 1 martin martin 1129 10. Dez 08:58 testcase.zip As you can see, directory is dated 8:38, even though the current time is 9:02. |
|
|
msg77504 - (view) |
Author: Horváth István Róbert (throbi) |
Date: 2008-12-10 08:44 |
Sorry, I thought that by selecting component "Windows" from the first combo box I specify that this problem occurs on a windows machine. I run win xp sp2. As you can see in the screenshot, the unpacked directory has the current date and time. |
|
|
msg77521 - (view) |
Author: Martin v. Löwis (loewis) *  |
Date: 2008-12-10 09:19 |
Can you debug this? Where specifically does the problem occur? |
|
|
msg77530 - (view) |
Author: Lars Gustäbel (lars.gustaebel) *  |
Date: 2008-12-10 10:15 |
Directory times are explicitly not set. The comment in TarFile.utime() says that it is an error on Windows to use utime on directories. I am no Windows expert, so I don't know if that is still true. |
|
|
msg77532 - (view) |
Author: Lars Gustäbel (lars.gustaebel) *  |
Date: 2008-12-10 11:04 |
Apparently it is not. os.utime() was fixed for Windows in Python 2.5 (r45925), so it should be possible for tarfile to set directory times now. I will prepare a patch. |
|
|
msg77535 - (view) |
Author: Horváth István Róbert (throbi) |
Date: 2008-12-10 11:32 |
Wooow, you're fast! :-) We use Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win32, so that will help us! Thank you, Robert On Wed, Dec 10, 2008 at 12:04 PM, Lars Gustäbel <report@bugs.python.org>wrote: > > Lars Gustäbel <lars@gustaebel.de> added the comment: > > Apparently it is not. os.utime() was fixed for Windows in Python 2.5 > (r45925), so it should be possible for tarfile to set directory times > now. I will prepare a patch. > > _______________________________________ > Python tracker <report@bugs.python.org> > <http://bugs.python.org/issue4616> > _______________________________________ > |
|
|
msg77674 - (view) |
Author: Lars Gustäbel (lars.gustaebel) *  |
Date: 2008-12-12 15:23 |
I checked the necessary changes in the trunk and the py3k, release26-maint, and release30-maint branches (r67717-r67720). Thank you for your report. |
|
|