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

Hirokazu Yamamoto report at bugs.python.org
Mon May 16 04:53:22 CEST 2011


New submission from Hirokazu Yamamoto <ocean-city at 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 passed to win32_xstat without converting to absolute path.

I'm sorry because I implemented this function, and it's hard for me to debug this because I don't have Vista/7. This patch uses GetFinalPathNameByHandle like original code does, plus should handle symlink to system locked file.

Can anyone test and commit this patch?

----------
components: Windows
files: patches_v2.tar.gz
keywords: 3.2regression
messages: 136062
nosy: georg.brandl, ocean-city
priority: release blocker
severity: normal
stage: patch review
status: open
title: os.stat() on windows doesn't consider relative symlink
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file22006/patches_v2.tar.gz

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12084>
_______________________________________


More information about the Python-bugs-list mailing list