[issue13412] No knowledge of symlinks on Windows
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +brian.curtin, tim.golden ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
New submission from Alex Regueiro alex...@gmail.com: Python 2.7 has no knowledge of directory symlinks on Windows 7. Listing a directory symlink does not work, nor does accessing a file within one. This is quite a notable missing feature on Windows 7, where symlinks are becoming increasingly prevalent. -- components: IO messages: 147715 nosy: alexreg priority: normal severity: normal status: open title: No knowledge of symlinks on Windows versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith, jason.coombs ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Changes by Florent Xicluna florent.xicl...@gmail.com: -- components: +Windows type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Jason R. Coombs jar...@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:50DIR . 11-Nov-2011 06:50DIR .. .. 11-Aug-2011 10:11SYMLINKD bin [Dropbox\bin\x64] 10-Aug-2011 21:00SYMLINKD 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 rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Brian Curtin br...@python.org added the comment: I think we could still make os.listdir work properly. I'll look into a patch for this. One problem here is the testability, since we'd need to rely on the mklink CLI app to create the symlinks, which requires that the calling application (python.exe) has elevated privileges. It wont be exercised by any of the buildbots. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Alex Regueiro alex...@gmail.com added the comment: What are you running? This is not what I get on Win7 x64, and I have had several other users in ##python on FreeNode confirm this inability. As far as Python is concerned, these dir sym links do not even exist. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Jason R. Coombs jar...@jaraco.com added the comment: I should mention that there is third-party symlink support in jaraco.windows (http://pypi.python.org/pypi/jaraco.windows). Just easy_install it, and then use jaraco.windows.filesystem.symlink. If there are features you need for symlink support in jaraco.windows, request them via https://bitbucket.org/jaraco/jaraco.windows and they should be implemented quickly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Alex Regueiro alex...@gmail.com added the comment: Thanks Bryan, that would be great. The elevated privs problem could potentially be avoided by creating symlinks using the Win32 API directly. As long as the appropiate group policy is set, one does not require admin privs to create symlinks. Perhaps symlink creation/deletion on Windows could even be integrated into the Python class library? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Jason R. Coombs jar...@jaraco.com added the comment: Brian, I'm still not sure I see the problem with os.listdir. It includes symlinks when listing a dir and traverses them naturally when referencing them as part of a path to listdir. Under what conditions does it fail? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Alex Regueiro alex...@gmail.com added the comment: Well, at the very least it's a system-dependent issue, since I've tried out listdir and also file access on my system and some other Windows users'. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Jason R. Coombs jar...@jaraco.com added the comment: Some variables could be a missing privilege or role, or perhaps a UAC restriction. What error do you get when you attempt to invoke os.listdir on a symlink directory? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Alex Regueiro alex...@gmail.com added the comment: No error whatsoever. Python just thinks it doesn't exist unfortunately. Same report from other users... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Brian Curtin br...@python.org added the comment: symlinks when listing a dir and traverses them naturally when referencing them as part of a path to listdir. Under what conditions does it fail? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ Jason - I'm responding on a phone - I haven't confirmed anything yet (and hadn't yet seen your examples when I was typing). Alex - the Windows API also requires elevation - that's what we have to do in 3.2+ as well. The symlink calls require a specific privilege which is only granted when elevated, even for the mklink program. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Alex Regueiro alex...@gmail.com added the comment: When listing the parent dir in which a dir symlink resides, the dir symlink doesn't show up. That's the one I noticed most. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Jason R. Coombs jar...@jaraco.com added the comment: On Windows Vista and Windows 7, there should be a symlink directory: C:\Documents and Settings - .\Users Perhaps a good test would be: assert 'Documents and Settings' in os.listdir('C:\\') As long as there aren't any i18n issues, and the system is a standard install, that test should only fail if os.listdir fails to return symlinks. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com