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

STINNER Victor report at bugs.python.org
Mon Jun 13 17:18:10 CEST 2011


STINNER Victor <victor.stinner at 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 replace Win32SymlinkTests.check_stat() method by:

    def check_stat(self, link, target):
        self.assertEqual(os.stat(link), os.stat(target))
        self.assertNotEqual(os.lstat(link), os.stat(link))

        bytes_link = os.fsencode(link)
        self.assertEqual(os.stat(bytes_link), os.stat(target))
        self.assertNotEqual(os.lstat(bytes_link), os.stat(bytes_link))

----------

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


More information about the Python-bugs-list mailing list