Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 17, 2009, 12:47 AM

Post #1 of 10 (509 views)
Permalink
[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows

Eric Smith <eric [at] trueblade> added the comment:

When building on XP with "windows symlink draft 15.patch", I get:

Build started: Project: _hashlib, Configuration: Release|Win32
Performing Pre-Build Event...
Found a working perl at 'c:\opt\cygwin\bin\perl.exe'
Found an SSL directory at '..\..\openssl-0.9.8g'
Traceback (most recent call last):
File "build_ssl.py", line 258, in <module>
main()
File "build_ssl.py", line 241, in main
shutil.copy(r"crypto\buildinf_%s.h" % arch, r"crypto\buildinf.h")
File "C:\home\eric\python\py3k\lib\shutil.py", line 102, in copy
copyfile(src, dst)
File "C:\home\eric\python\py3k\lib\shutil.py", line 50, in copyfile
if _samefile(src, dst):
File "C:\home\eric\python\py3k\lib\shutil.py", line 40, in _samefile
return os.path.samefile(src, dst)
File "C:\home\eric\python\py3k\lib\ntpath.py", line 635, in samefile
return _getfinalpathname(f1) == _getfinalpathname(f2)
NotImplementedError: GetFinalPathNameByHandle not available on this platform
Project : error PRJ0019: A tool returned an error code from "Performing
Pre-Build Event..."
Build log was saved at
"file://C:\home\eric\python\py3k\PCbuild\Win32-temp-Release\_hashlib\BuildLog
.htm"
_hashlib - 1 error(s), 0 warning(s)

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1578269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 26, 2009, 5:40 PM

Post #2 of 10 (439 views)
Permalink
[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows [In reply to]

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

Thanks Eric for the report. I had tested earlier on XP, but didn't do so
with the latest changes. It appears that a couple of modules didn't
behave well under XP. The latest patch (16) addresses these issues. In
particular, many tests use the presence of os.symlink to presume
symbolic link support, but under Windows XP, os.symlink exists but
raises a NotImplementedError when called. To address this, I added
test.support.has_symlink function which can be used to determine whether
the OS has symlink support (and not just a symlink function).

This raises the issue that it might be worthwhile to remove the symlink
and readlink methods at the os module init time if symlinks aren't
supported on the OS.

For now, this implementation should be adequate to move forward.

----------
Added file: http://bugs.python.org/file15403/windows symlink draft 16.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1578269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 5, 2009, 5:34 PM

Post #3 of 10 (410 views)
Permalink
[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows [In reply to]

Andrew Svetlov <andrew.svetlov [at] gmail> added the comment:

Jason, as I see you implemented os.samefile (actually ntpath.samefile)
but os.sameopenfile is still not implemented.

Looks like it's easy to do: while GetFinalPathNameByHandle already
accept file handle you can use CRT function _get_osfhandle(fd) to
convert file descriptors (arguments for sameopenfile) to file handles
and pass it to GetFinalPathNameByHandle.

For me samefile and sameopenfile has very close semantic and I like to
see both if it's possible.

Thanks.

----------
nosy: +asvetlov

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1578269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 17, 2009, 4:48 PM

Post #4 of 10 (378 views)
Permalink
[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows [In reply to]

Eric Smith <eric [at] trueblade> added the comment:

I apologize (again) Jason, for taking forever to move forward on this.

With patch 16 on XP, I get this error on test_platform:

======================================================================
ERROR: test_architecture_via_symlink (__main__.PlatformTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "Lib/test/test_platform.py", line 22, in
test_architecture_via_symlink
os.symlink(real, link)
NotImplementedError: CreateSymbolicLinkW not found

----------------------------------------------------------------------
Ran 18 tests in 0.047s

FAILED (errors=1)
Traceback (most recent call last):
File "Lib/test/test_platform.py", line 204, in <module>
test_main()
File "Lib/test/test_platform.py", line 200, in test_main
PlatformTest
File "c:\home\eric\python\py3k\lib\test\support.py", line 919, in
run_unittest
_run_suite(suite)
File "c:\home\eric\python\py3k\lib\test\support.py", line 902, in
_run_suite
raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
File "Lib/test/test_platform.py", line 22, in
test_architecture_via_symlink
os.symlink(real, link)
NotImplementedError: CreateSymbolicLinkW not found

I'll try to spend some time tracking it down over the weekend, but feel
free to look it over.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1578269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 19, 2009, 4:15 PM

Post #5 of 10 (374 views)
Permalink
[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows [In reply to]

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

This attached patch addresses the issue Eric mentioned - I don't know
how I missed this before. I will attempt to run the tests on XP again
with this change, but have not yet done so.

----------
Added file: http://bugs.python.org/file15616/windows symlink draft 17.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1578269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 22, 2009, 5:57 AM

Post #6 of 10 (366 views)
Permalink
[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows [In reply to]

Eric Smith <eric [at] trueblade> added the comment:

With patch 17 all tests pass on XP. I'm (still) working on getting a
Windows 7 environment to test there.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1578269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 22, 2009, 4:28 PM

Post #7 of 10 (364 views)
Permalink
[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows [In reply to]

Changes by Jason R. Coombs <jaraco [at] jaraco>:


Removed file: http://bugs.python.org/file15219/windows symlink draft 15.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1578269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 22, 2009, 4:29 PM

Post #8 of 10 (365 views)
Permalink
[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows [In reply to]

Changes by Jason R. Coombs <jaraco [at] jaraco>:


Removed file: http://bugs.python.org/file15403/windows symlink draft 16.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1578269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 22, 2009, 5:00 PM

Post #9 of 10 (365 views)
Permalink
[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows [In reply to]

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

Andrew, thanks for pointing out the apparent mismatch of having
ntpath.samefile but not ntpath.sameopenfile. Since this behavior doesn't
immediately affect the support of os.symlink, I've created a separate
issue, issue7566, to track that effort.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1578269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Dec 22, 2009, 5:02 PM

Post #10 of 10 (369 views)
Permalink
[issue1578269] Add os.link() and os.symlink() and os.path.islink() support for Windows [In reply to]

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

Eric: That's great news. I was gearing up to test myself to see if I
could reproduce the issue, but I'm glad it works since you beat me to
it. Let me know if it would help to provide a Windows 7 VMWare Player
virtual machine.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue1578269>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.