[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-14 Thread Brian Curtin
Brian Curtin added the comment: Just had a successful XP buildbot run: http://www.python.org/dev/buildbot/all/builders/x86%20XP-5%203.2/builds/304 -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python t

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-14 Thread Brian Curtin
Brian Curtin added the comment: I think quick3 is the way to go - checked in, we'll see how the buildbots react. 1524a60016d0 is the changeset for the 3.2 checkin (forgot to mention the issue# there) -- ___ Python tracker

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 23e14af406df by Brian Curtin in branch 'default': Merge 3.2 - update to the fix for #12084 http://hg.python.org/cpython/rev/23e14af406df -- ___ Python tracker ___

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-14 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Added file: http://bugs.python.org/file22363/quick3.patch ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-14 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Added file: http://bugs.python.org/file22362/quick2.patch ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-14 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: I created several patches. quick1.patch: os.stat() traverses junction on Vista/7, and raises error on XP. quick2.patch: os.stat() never traverse junction on all windows. quick3.patch: os.stat() should traverse junction os Vista/7, but doesn't on XP. There ar

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-14 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: I tried issue12084_XP.diff, but os.stat()/os.lstat() always failed with following message because it raises exception on top of it when running on XP. Python 3.2.1rc1+ (default, Jun 14 2011, 16:26:11) [MSC v.1200 32 bit (Intel)] on win32 Type "help", "copy

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread Brian Curtin
Brian Curtin added the comment: How about this patch? We yield the GIL in posix_do_stat, so as Antoine pointed out in IRC, we were calling PyErr_SetString without having the GIL. I think this is the correct fix as I've stepped through the code in Visual Studio, forcing it to take this branch

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread Brian Curtin
Brian Curtin added the comment: It has something to do with the GetFinalPathNameByHandle dance. -- ___ Python tracker ___ ___ Python-

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread Jason R. Coombs
Jason R. Coombs added the comment: I'll take a look. -- Added file: http://bugs.python.org/file22357/smime.p7s ___ Python tracker ___ smime.p7s Description: S/MIME cryptographi

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread Brian Curtin
Brian Curtin added the comment: Well apparently that killed the XP build bots. Does anyone currently have access to XP that could test this? -- ___ Python tracker ___ _

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1a3e8db28d49 by Brian Curtin in branch '3.2': Fix #12084. os.stat on Windows wasn't working properly with relative symlinks. http://hg.python.org/cpython/rev/1a3e8db28d49 New changeset c04c55afbf81 by Brian Curtin in branch 'default': Merge from 3.

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: > Here's a cleaned up patch which includes the test and lstat change > Victor mentioned. The test pass on Windows Seven 64 bits. -- ___ Python tracker ___

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread Brian Curtin
Brian Curtin added the comment: Here's a cleaned up patch which includes the test and lstat change Victor mentioned. I think this addresses everything we need to cover here. Can you run the tests once more with this new patch? -- Added file: http://bugs.python.org/file22342/issue12084

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: > os.lstat(bytes) should call win32_lstat() > (which is removed by this patch) instead of stat() Short history: - 0a1baa619171: Fix #10027. st_nlink not set on Windows calls to os.stat/lstat - 730b728e5aef: Implement #1578269. Patch by Jason R. Coombs. 730b728

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-13 Thread STINNER Victor
STINNER Victor added the comment: issue12084_v2.diff doesn't patch os.lstat(bytes): os.lstat(bytes) should call win32_lstat() (which is removed by this patch) instead of stat(). test_os doesn't test os.stat()/os.lstat() with byte filenames. You can for example replace Win32SymlinkTests.check_

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-07 Thread Brian Curtin
Brian Curtin added the comment: Victor - does the new patch pass all tests for you on 3.2? -- Added file: http://bugs.python.org/file22274/issue12084_v2.diff ___ Python tracker

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-07 Thread Brian Curtin
Brian Curtin added the comment: I should have specified - the patch is for 3.2. 2.7 code in this area is different but I'll get to that, and default/3.3 will also get this patch but it'll probably require some tweaking. I guess I went overboard on the refactoring which is why Victor is seeing

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-07 Thread STINNER Victor
STINNER Victor added the comment: Oh oh. The situation is not a simple as expected. 3 functions only accept Unicode strings and 3 other functions decode "manually" byte strings from the ANSI code page. -- chdir(), rmdir(), unlink(), access(), chmod(), link(), listdir(), _getfullpath(), mkdi

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-07 Thread Tim Golden
Tim Golden added the comment: All expected tests pass on 3.2 branch (Win7 32-bit). The patch doesn't apply cleanly to trunk; not sure if it's expected to or not. The code looks ok on paper. I'll leave Victor to quibble over the Unicode stuff... -- _

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-07 Thread STINNER Victor
STINNER Victor added the comment: Win32SymlinkTests.test_rmdir_on_directory_link_to_missing_target() pass on my Windows 7 64 bits VM (with and without the patch), but is skipped: @unittest.skip("currently fails; consider for improvement") def test_rmdir_on_directory_link_to_missing_tar

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-07 Thread STINNER Victor
STINNER Victor added the comment: issue12084.diff: - test_os pass with patched Python 3.3 on Windows 7 64 bits (and on Linux, Debian Sid) - in test_os: "finally: os.remove(file1)" fails with file1 doesn't exist: a new try/finally should be used after "with open(file1, "w") as f:" block, or

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-07 Thread Tim Golden
Tim Golden added the comment: I'm just patching a clone now. -- nosy: +tim.golden ___ Python tracker ___ ___ Python-bugs-list mailing

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-07 Thread Georg Brandl
Georg Brandl added the comment: Any Windows person going to review this one? -- ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-02 Thread Brian Curtin
Brian Curtin added the comment: Attached is a complete patch. All tests pass. Lib/test/support.py * Handle AttributeError, which Hirokazu noticed on pre-XP machines Lib/test/test_os.py * This sets up a three-deep directory tree and creates a symbolic link in the middle (second) directory.

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-06-01 Thread Brian Curtin
Brian Curtin added the comment: I have this working when you stat the symlink from the directory it was created or above...but oddly it does not work when you open a symlink below the directory it exists in. DeviceIoControl isn't used for reparse tag handling anymore, and I'm using GetFinalP

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-29 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Removed file: http://bugs.python.org/file22006/patches_v2.tar.gz ___ Python tracker ___ ___ Python-bugs-list ma

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-29 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Added file: http://bugs.python.org/file22183/patch_v2.txt ___ Python tracker ___ ___ Python-bugs-list mailing l

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-29 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Added file: http://bugs.python.org/file22182/patch_v2.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-28 Thread Jason R. Coombs
Jason R. Coombs added the comment: To the extent that we can, we should try to support relative symlinks. Absolute symlinks aren't the right thing in some cases, where the symlinks should be movable with their targets. I use relative links extensively. Is it worth considering changing the cur

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-27 Thread Brian Curtin
Brian Curtin added the comment: It turns out DeviceIoControl/FSCTL_GET_REPARSE_POINT (in win32_read_link) will only work for us as long as the symlink was created with a full path. Starting at the top level of a source checkout, if I create `os.symlink("README", "README.lnk")` and then do `os

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-26 Thread Brian Curtin
Brian Curtin added the comment: Ok, so it's actually 0a1baa619171 that broke it, not sure how I came up with the other revision. In any case, it's too hairy to try and piece everything together across the numerous bug fixes, feature adds, and refactorings in this area in order to get back to

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-24 Thread Brian Curtin
Brian Curtin added the comment: Correction for msg136711 -- s/patch/test/g -- ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-23 Thread Brian Curtin
Brian Curtin added the comment: Ok, so it's 893b098929e7 where that test stops working. -- ___ Python tracker ___ ___ Python-bugs-lis

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-23 Thread Brian Curtin
Brian Curtin added the comment: Here's standalone patch which should cover this problem. The patch fails right now but succeeds if you apply it back to 652baf23c368 (the changeset before one of several changes around this code). I'll try to find the actual offending checkin and workout the di

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-18 Thread Brian Curtin
Brian Curtin added the comment: With the patch applied, the new test fails along with test.test_os.WalkTests.test_traversal and test.test_os.Win32SymlinkTests.test_directory_link. Overall, I agree that this doesn't work correctly. The patch, which is pretty large, breaks more than it fixes.

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-18 Thread Jason R. Coombs
Jason R. Coombs added the comment: Brian, I'm available to help with this tomorrow evening; let me know if you want to team up on it then. -- ___ Python tracker ___ ___

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-18 Thread Brian Curtin
Brian Curtin added the comment: I'm hoping to. I have time to work on it tonight and tomorrow night US/Chicago time and will keep you posted. -- assignee: -> brian.curtin ___ Python tracker _

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-18 Thread Georg Brandl
Georg Brandl added the comment: Brian, do you think you'll be able to finish this for 3.2.1? If we do fix it, we'd need a second rc (not a problem for me). -- ___ Python tracker __

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-16 Thread Brian Curtin
Changes by Brian Curtin : -- Removed message: http://bugs.python.org/msg136132 ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-16 Thread Brian Curtin
Brian Curtin added the comment: Looks like I was referring to a different patch from the email - sorry for any confusion. -- ___ Python tracker ___

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-16 Thread Santoso Wijaya
Changes by Santoso Wijaya : -- nosy: +santa4nt ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-16 Thread Brian Curtin
Brian Curtin added the comment: Hirokazu contacted me directly with these patches a few days ago but I haven't been able to email him because his host's DNS is apparently down. The tests in this patch do not end up testing anything, so we'll need to start with a proper test. In the brief look

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-15 Thread Eric V. Smith
Changes by Eric V. Smith : -- nosy: +eric.smith, jaraco ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-15 Thread Georg Brandl
Georg Brandl added the comment: It's quite a large patch... :) I now own a new laptop that had Windows 7 preinstalled, so I'll try to get set up VC++ Express, and then test the patch. Still I'm nosying Martin as well. For the future, it's much easier to just attach both files individually, th

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-15 Thread Nadeem Vawda
Changes by Nadeem Vawda : -- nosy: +nadeem.vawda ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue12084] os.stat() on windows doesn't consider relative symlink

2011-05-15 Thread Hirokazu Yamamoto
New submission from Hirokazu Yamamoto : Hello. I noticed os.stat() on windows may traverse wrong path on relative symbolic when current working directory != the directory where symbolic link is in. This is because the relative path DeviceIoControl() returns is just passed to win32_xstat withou