Christian Heimes added the comment:

On my Windows box (Win 7) I'm getting an error with Python 3.2 and 3.3. It 
looks like I'm not allowed to enter the parent directory (Zugriff verweigert == 
Permission Denied):

>>> os.stat(r'C:\Windows\System32\config')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
WindowsError: [Error 5] Zugriff verweigert: 'C:\\Windows\\System32\\config'

In order to reproduce your problem anyway I have created a directory, a 
junction point and a symlink (as admin):

> mkdir testdir
> mklink /j testjunktion testdir
> mklink /d testlinkk testdir

Neither os.stat() nor os.lstat() have failed with an exception. There must be 
something different going on on your system.


By the way junction points are soft links but not symbolic links. They are 
implemented as a different kind of NTFS reparsing points. Python should not 
treat a junction point as a link but have yet another check for it.

>>> os.lstat(r'c:\users\heimes\testdir')
nt.stat_result(st_mode=16895, st_ino=58265320179130300, st_dev=3366304641, 
st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1372247959, 
st_mtime=1372247959, st_ctime=1372247959)

>>> os.lstat(r'c:\users\heimes\testjunction')
nt.stat_result(st_mode=16895, st_ino=4785074604141776, st_dev=3366304641, 
st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1372247983, 
st_mtime=1372247983, st_ctime=1372247983)

>>> os.lstat(r'c:\users\heimes\testlink')
nt.stat_result(st_mode=41471, st_ino=12384898975270541, st_dev=3366304641, 
st_nlink=1, st_uid=0, st_gid=0, st_size=0, st_atime=1372249830, 
st_mtime=1372249830, st_ctime=1372249830)


PS: You should use raw strings on Windows or escape the backslashes.

----------
assignee: christian.heimes -> 
nosy: +loewis

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18306>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to