This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname
Type: enhancement Stage: resolved
Components: Library (Lib), Unicode, Windows Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: steve.dower Nosy List: eryksun, ezio.melotti, miss-islington, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Priority: normal Keywords: patch

Created on 2018-01-15 15:22 by eryksun, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 5761 merged steve.dower, 2018-02-19 22:56
PR 5816 merged miss-islington, 2018-02-22 18:39
Messages (3)
msg309990 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2018-01-15 15:22
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.
msg312578 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2018-02-22 18:39
New changeset 23ad6d0d1a7a6145a01494f4f3913a63d1f0250c by Steve Dower in branch 'master':
bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now correctly convert from bytes. (GH-5761)
https://github.com/python/cpython/commit/23ad6d0d1a7a6145a01494f4f3913a63d1f0250c
msg312585 - (view) Author: miss-islington (miss-islington) Date: 2018-02-22 19:02
New changeset 01dd52fb29566893dde59dea7bca582625c04762 by Miss Islington (bot) in branch '3.7':
bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now correctly convert from bytes. (GH-5761)
https://github.com/python/cpython/commit/01dd52fb29566893dde59dea7bca582625c04762
History
Date User Action Args
2022-04-11 14:58:56adminsetgithub: 76737
2018-09-21 20:46:32steve.dowersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-02-22 19:02:14miss-islingtonsetnosy: + miss-islington
messages: + msg312585
2018-02-22 18:39:35miss-islingtonsetpull_requests: + pull_request5591
2018-02-22 18:39:19steve.dowersetmessages: + msg312578
2018-02-20 00:22:39steve.dowersetstage: needs patch -> patch review
2018-02-19 22:56:33steve.dowersetassignee: steve.dower
stage: patch review -> needs patch
versions: + Python 3.7
2018-02-19 22:56:00steve.dowersetkeywords: + patch
stage: needs patch -> patch review
pull_requests: + pull_request5539
2018-01-28 21:12:56eryksunlinkissue32693 superseder
2018-01-15 15:22:10eryksuncreate