[issue13412] No knowledge of symlinks on Windows

Jason R. Coombs report at bugs.python.org
Tue Nov 15 23:54:24 CET 2011


Jason R. Coombs <jaraco at jaraco.com> added the comment:

Python 2.7 is not aware of symlinks and treats them like their targets, so it should be able to list a symlink directory or access a file within one. For example:

PS C:\Users\jaraco> cmd /c dir
 Volume in drive C is system
 Volume Serial Number is 2455-92A0

 Directory of C:\Users\jaraco

11-Nov-2011  06:50    <DIR>          .
11-Nov-2011  06:50    <DIR>          ..
..
11-Aug-2011  10:11    <SYMLINKD>     bin [Dropbox\bin\x64]
10-Aug-2011  21:00    <SYMLINKD>     bin-x86 [Dropbox\bin\x86]
..
              11 File(s)          6,632 bytes
              27 Dir(s)  301,972,422,656 bytes free
PS C:\Users\jaraco> python
Python 2.7.2 (default, Jun 12 2011, 14:24:46) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.listdir('bin')
['curl.exe', 'devcon.exe', 'HotSwap!.EXE', 'Notepad2.exe', 'utorrent.exe', 'vncviewer.exe']
>>> with open('bin/curl.exe', 'rb') as f:
...   f.read()[:10]
...
'MZ\x90\x00\x03\x00\x00\x00\x04\x00'
>>> ^Z

Because Python 2.7 is feature-frozen, symlink support will not be available in Python before 3.2.

If you are experiencing errors, please reopen this ticket and describe what you are doing, what you expect, and what you get instead.

----------
resolution:  -> wont fix
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13412>
_______________________________________


More information about the Python-bugs-list mailing list