[New-bugs-announce] [issue32556] support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname

Eryk Sun report at bugs.python.org
Mon Jan 15 10:22:10 EST 2018


New submission from Eryk Sun <eryksun at gmail.com>:

In issue 26330 it was noted that nt._getdiskusage doesn't accept bytes paths. The same applies to nt._getvolumepathname and nt._getfinalpathname. Callers of these functions shouldn't have to manually implement PEP 529 UTF-8 support to handle input and output bytes paths. 

On the other hand, nt._getfullpathname works with a bytes path since it takes a `path_t` argument instead of `unicode` or `Py_UNICODE`. The above 3 functions could be rewritten to use `path_t` for the input path, and then encode the output path via PyUnicode_EncodeFSDefault if path->narrow is set.

----------
components: Library (Lib), Unicode, Windows
messages: 309990
nosy: eryksun, ezio.melotti, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32556>
_______________________________________


More information about the New-bugs-announce mailing list