Message191899
If os.stat is executed on a Windows junction with Python 3.3 I see an exception:
------------
>>> import os
>>> os.stat('C:\Windows\System32\config\systemprofile\SendTo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\Windows\\System32\\config\\systemprofile\\SendTo'
------------
whereas with Python 3.2 it works without error:
------------
>>> import os
>>> os.stat('C:\Windows\System32\config\systemprofile\SendTo')
nt.stat_result(st_mode=16895, st_ino=281474977136630, st_dev=0, st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1295885671, st_mtime=1295885671, st_ctime=1295885671)
------------
FTR. Some background:
It's a pity that Python doesn't just treat Windows junctions as a normal soft link. But given that islink() returns False for a junction, I was able to work around that in Python 3.2 like this:
------------
if os.path.islink(fullname) or \
os.stat(fullname)[stat.ST_INO] != os.lstat(fullname)[stat.ST_INO]:
# If it's not a link, it's probably a junction...
------------
Many thanks for looking.
John |
|
Date |
User |
Action |
Args |
2013-06-26 08:45:00 | John.Jefferies | set | recipients:
+ John.Jefferies |
2013-06-26 08:45:00 | John.Jefferies | set | messageid: <1372236300.43.0.559187613539.issue18306@psf.upfronthosting.co.za> |
2013-06-26 08:45:00 | John.Jefferies | link | issue18306 messages |
2013-06-26 08:44:59 | John.Jefferies | create | |
|