Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp 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)]
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp 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,
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp:
Added file: http://bugs.python.org/file22362/quick2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp:
Added file: http://bugs.python.org/file22363/quick3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
Roundup Robot devnull@devnull 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 rep...@bugs.python.org
Brian Curtin br...@python.org 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
Brian Curtin br...@python.org 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
STINNER Victor victor.stin...@haypocalc.com 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
STINNER Victor victor.stin...@haypocalc.com 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
Brian Curtin br...@python.org 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:
STINNER Victor victor.stin...@haypocalc.com 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 rep...@bugs.python.org
Roundup Robot devnull@devnull 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
Brian Curtin br...@python.org added the comment:
Well apparently that killed the XP build bots. Does anyone currently have
access to XP that could test this?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
Jason R. Coombs jar...@jaraco.com added the comment:
I'll take a look.
--
Added file: http://bugs.python.org/file22357/smime.p7s
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
Brian Curtin br...@python.org added the comment:
It has something to do with the GetFinalPathNameByHandle dance.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
Brian Curtin br...@python.org 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
Georg Brandl ge...@python.org added the comment:
Any Windows person going to review this one?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
Tim Golden m...@timgolden.me.uk added the comment:
I'm just patching a clone now.
--
nosy: +tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
STINNER Victor victor.stin...@haypocalc.com 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
STINNER Victor victor.stin...@haypocalc.com 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
Tim Golden m...@timgolden.me.uk 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...
--
STINNER Victor victor.stin...@haypocalc.com 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(),
Brian Curtin br...@python.org 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
Brian Curtin br...@python.org 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 rep...@bugs.python.org
http://bugs.python.org/issue12084
Brian Curtin br...@python.org 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
Brian Curtin br...@python.org 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
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp:
Added file: http://bugs.python.org/file22182/patch_v2.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp:
Added file: http://bugs.python.org/file22183/patch_v2.txt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp:
Removed file: http://bugs.python.org/file22006/patches_v2.tar.gz
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
Jason R. Coombs jar...@jaraco.com 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
Brian Curtin br...@python.org 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)`
Brian Curtin br...@python.org 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
Brian Curtin br...@python.org added the comment:
Correction for msg136711 -- s/patch/test/g
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
Brian Curtin br...@python.org 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
Brian Curtin br...@python.org added the comment:
Ok, so it's 893b098929e7 where that test stops working.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
Georg Brandl ge...@python.org 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 rep...@bugs.python.org
Brian Curtin br...@python.org 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 rep...@bugs.python.org
Jason R. Coombs jar...@jaraco.com 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 rep...@bugs.python.org
http://bugs.python.org/issue12084
Brian Curtin br...@python.org 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
Georg Brandl ge...@python.org 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
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith, jaraco
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
___
Brian Curtin br...@python.org 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.
Changes by Santoso Wijaya santoso.wij...@gmail.com:
--
nosy: +santa4nt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
___
Brian Curtin br...@python.org added the comment:
Looks like I was referring to a different patch from the email - sorry for any
confusion.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
Changes by Brian Curtin br...@python.org:
--
Removed message: http://bugs.python.org/msg136132
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
New submission from Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp:
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
Changes by Nadeem Vawda nadeem.va...@gmail.com:
--
nosy: +nadeem.vawda
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12084
___
___
47 matches
Mail list logo