[issue8879] Implement os.link on Windows

2011-01-03 Thread Brian Curtin
Changes by Brian Curtin : -- stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ ___ Python-bugs-li

[issue8879] Implement os.link on Windows

2010-11-28 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: I am not familiar with this either, but better to restrict the test to platforms with actual mbcs encoding. -- ___ Python tracker ___

[issue8879] Implement os.link on Windows

2010-11-28 Thread Brian Curtin
Brian Curtin added the comment: Maybe the test should be Windows-only? I don't really know the answer...things tend to fall apart when I get involved with Unicode, encoding, codecs, etc. :/ -- ___ Python tracker _

[issue8879] Implement os.link on Windows

2010-11-28 Thread Jesús Cea Avión
Jesús Cea Avión added the comment: This patch seems to break quite a few buildbots. for instance: http://www.python.org/dev/buildbot/all/builders/x86%20OpenIndiana%203.x/builds/81/steps/test/logs/stdio """ test_mbcs_name (test.test_os.LinkTests) ... test test_os failed -- Traceback (most rec

[issue8879] Implement os.link on Windows

2010-11-28 Thread Brian Curtin
Brian Curtin added the comment: Committed in r86854 with your win32_error suggestion. Thanks for your help and input. -- ___ Python tracker ___ _

[issue8879] Implement os.link on Windows

2010-11-28 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: Looks good, except that win32_error("link", NULL) should be called instead of posix_error(). errno is not guaranteed to be correctly set by the win32 api, and GetLastError() ususally gives more accurate errors. -- __

[issue8879] Implement os.link on Windows

2010-11-28 Thread Brian Curtin
Brian Curtin added the comment: Amaury -- how does issue8879_unicode.diff look? Made the suggested change and added a test. -- stage: committed/rejected -> patch review Added file: http://bugs.python.org/file19862/issue8879_unicode.diff ___ Python t

[issue8879] Implement os.link on Windows

2010-11-25 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : -- Removed message: http://bugs.python.org/msg122421 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue8879] Implement os.link on Windows

2010-11-25 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: Or, use GetFileInformationByHandleEx on Vista or above, and NtQueryInformationFile under Vista. NtQueryInformationFile is windows internal function and MS may change its behavior, but probably we can think it won't happen on WinXP. # These functions are need

[issue8879] Implement os.link on Windows

2010-11-25 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: Umm, I'm not sure how to fix this yet, but if we create the function like os._stat_with_open_handle() which returns stat struct and open handle on windows, I think we can set/use st_ino. (Because FileID won't change while file is opened) I'm not sure if it is

[issue8879] Implement os.link on Windows

2010-11-25 Thread Brian Curtin
Brian Curtin added the comment: I'll come up with a patch for Amaury's message. Hirokazu - I didn't see that MSDN page, thanks. Without st_ino, I'll need to find a way around the block of lines 1941-1954 in Lib/tarfile.py. That's what was causing a test failure in the first place because it e

[issue8879] Implement os.link on Windows

2010-11-24 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: r86733 introduces st_ino setup in attribute_data_to_stat(), but Fild ID is not guaranteed to be same when file is not opened. So I think it's meaningful only for os.fstat(). Please see http://msdn.microsoft.com/en-us/library/aa363788%28v=VS.85%29.aspx -

[issue8879] Implement os.link on Windows

2010-11-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The patch uses the ANSI version, and converts the filename from unicode to bytes; this will fail for names that cannot be encoded with the "mbcs" codec. All other functions in the posix module first try the Wide version of the win32 API, and use the ANS

[issue8879] Implement os.link on Windows

2010-11-24 Thread Brian Curtin
Brian Curtin added the comment: Fixed in r86733. -- stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue8879] Implement os.link on Windows

2010-11-24 Thread Brian Curtin
Brian Curtin added the comment: Removing link to #10027. It's fixed for py3k but the issue should stay open for backport to other branches. -- dependencies: -os.lstat/os.stat don't set st_nlink on Windows resolution: -> fixed ___ Python tracker <

[issue8879] Implement os.link on Windows

2010-10-05 Thread Brian Curtin
Brian Curtin added the comment: I created #10027 for the st_nlink issue to handle it separately. -- dependencies: +os.lstat/os.stat don't set st_nlink on Windows ___ Python tracker _

[issue8879] Implement os.link on Windows

2010-10-01 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: I think this is because os.stat and os.lstat doesn't set st_nlink. It is only set via os.fstat. I'll attach quick hack patch. (Again, this is just quick hack patch) I confirmed this passes test_os and test_tarfile. -- Added file: http://bugs.python.

[issue8879] Implement os.link on Windows

2010-10-01 Thread Brian Curtin
Brian Curtin added the comment: test_tarfile fails with this patch. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

[issue8879] Implement os.link on Windows

2010-09-29 Thread Brian Curtin
Brian Curtin added the comment: Now that I think of it, that behavior is expected. Hard links are *supposed* to be different directory entries, so they would come out of that function as-is, and the current tests are correctly implemented. Uploaded to http://codereview.appspot.com/2290042 --

[issue8879] Implement os.link on Windows

2010-09-24 Thread Brian Curtin
Brian Curtin added the comment: In a round-about way, that's what the tests do via sameopenfile. Maybe the behavior of os.path.samefile for Windows hard links should be documented? Possibly just a small note explaining that os.path.sameopenfile is an alternate solution due to how GetFinalPath

[issue8879] Implement os.link on Windows

2010-09-23 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: With following implementation, issamefile return True for hard link. I heard GetFinalPathNameByHandle returns different paths for hard links. >>> import nt, os >>> def issamefile(path1, path2): ... fd1 = os.open(path1, os.O_RDONLY) ... fd2 = os.open(

[issue8879] Implement os.link on Windows

2010-09-23 Thread Brian Curtin
Brian Curtin added the comment: Here's a patch of the functionality. The doc change is small and easy, I'll add it shortly. One oddity is that os.path.samefile is False for a link and its source, but True for a symlink and its source. I find that to be quite odd, but stepping through the cod

[issue8879] Implement os.link on Windows

2010-07-23 Thread Brian Curtin
Changes by Brian Curtin : -- dependencies: +Add ntpath.sameopenfile support for Windows ___ Python tracker ___ ___ Python-bugs-list mai

[issue8879] Implement os.link on Windows

2010-06-02 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola' : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue8879] Implement os.link on Windows

2010-06-02 Thread Brian Curtin
New submission from Brian Curtin : Add os.link support for Windows (mostly a reminder to myself to finish the patch I have) -- assignee: brian.curtin components: Extension Modules, Windows messages: 106908 nosy: brian.curtin priority: normal severity: normal stage: needs patch status: