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.

Author John.Jefferies
Recipients John.Jefferies
Date 2013-06-26.08:44:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1372236300.43.0.559187613539.issue18306@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2013-06-26 08:45:00John.Jefferiessetrecipients: + John.Jefferies
2013-06-26 08:45:00John.Jefferiessetmessageid: <1372236300.43.0.559187613539.issue18306@psf.upfronthosting.co.za>
2013-06-26 08:45:00John.Jefferieslinkissue18306 messages
2013-06-26 08:44:59John.Jefferiescreate