[New-bugs-announce] [issue29248] os.readlink fails on Windows

Eryk Sun report at bugs.python.org
Thu Jan 12 03:09:20 EST 2017


New submission from Eryk Sun:

win_readlink in Modules/posixmodule.c mistakenly treats the PrintNameOffset field of the reparse data buffer as a number of characters instead of bytes. Thus, if the offset is non-zero, the value returned is incorrect stack garbage. For example, the following should return "C:\\ProgramData":

    >>> os.readlink(r'C:\Users\All Users')
    '\u6c20\u3012\u041f\x01\u2768\u60b2\u031b\x02\x05\x00\u031e\x06\u8c01\u4012'

Craig Holmquist found this bug, as detailed in message 277385. He included a fix in the patch for issue 23407, but this should be addressed in the next maintenance release of 3.5 and 3.6.

----------
components: Library (Lib), Windows
messages: 285294
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: os.readlink fails on Windows
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

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


More information about the New-bugs-announce mailing list