Title: tarfile: adding filed that use direct device addressing
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: lars.gustaebel Nosy List: georg.brandl, lars.gustaebel, urbanp
Priority: normal Keywords: patch

Created on 2005-08-30 07:50 by urbanp, last changed 2007-08-24 10:23 by lars.gustaebel. This issue is now closed.

File name Uploaded Description Edit
tarfile_win.diff urbanp, 2005-08-30 07:50 patch to Lib/
Messages (3)
msg48698 - (view) Author: Urban Purkat (urbanp) Date: 2005-08-30 07:50
The module tarfile has problems using os.stat() if the
filenames use direct device addressing on Windows systems. 
For example:

The following error is reported:
Traceback (most recent call last):
  File "C:\urbanp\py\", line 9, in ?
  File "C:\PROGRA~1\Python23\lib\", line
1204, in add
    tarinfo = self.gettarinfo(name, arcname)
  File "C:\PROGRA~1\Python23\lib\", line
1080, in gettarinfo
    statres = os.lstat(name)
OSError: [Errno 2] No such file or directory:

As a solution we can use win32file.GetFileAttributesEx().
I mapped win32file.GetFileAttributesEx result into a
tuple that has the same structure as a os.stat result
tuple. Therefore, the same variable can be used.

The reason for using direct device addressing is that I
need to create a tar package from a volume snapshot
(vss on Windows 2003) that cannot be mounted.
The solution also works on StorageCraft VSnap snapshots.
msg48699 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-08-31 22:13
Logged In: YES 

I don't know whether direct device addressing is officially
supported by any part of Python anyway.
msg55247 - (view) Author: Lars Gustäbel (lars.gustaebel) * (Python committer) Date: 2007-08-24 10:23
Closing this due to lack of interest. This is no tarfile issue. If
direct device addressing should be supported by Python, os.stat() would
be the place to implement it.
Date User Action Args
2007-08-24 10:23:20lars.gustaebelsetstatus: open -> closed
resolution: wont fix
messages: + msg55247
2005-08-30 07:50:25urbanpcreate