Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname #76737

Closed
eryksun opened this issue Jan 15, 2018 · 3 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes OS-windows stdlib Python modules in the Lib dir topic-unicode type-feature A feature request or enhancement

Comments

@eryksun
Copy link
Contributor

eryksun commented Jan 15, 2018

BPO 32556
Nosy @pfmoore, @vstinner, @tjguk, @ezio-melotti, @zware, @eryksun, @zooba, @miss-islington
PRs
  • bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now correctly convert from bytes #5761
  • [3.7] bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now correctly convert from bytes. (GH-5761) #5816
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/zooba'
    closed_at = <Date 2018-09-21.20:46:32.124>
    created_at = <Date 2018-01-15.15:22:10.157>
    labels = ['3.7', '3.8', 'OS-windows', 'type-feature', 'library', 'expert-unicode']
    title = 'support bytes paths in nt _getdiskusage, _getvolumepathname, and _getfinalpathname'
    updated_at = <Date 2018-09-21.20:46:32.123>
    user = 'https://github.com/eryksun'

    bugs.python.org fields:

    activity = <Date 2018-09-21.20:46:32.123>
    actor = 'steve.dower'
    assignee = 'steve.dower'
    closed = True
    closed_date = <Date 2018-09-21.20:46:32.124>
    closer = 'steve.dower'
    components = ['Library (Lib)', 'Unicode', 'Windows']
    creation = <Date 2018-01-15.15:22:10.157>
    creator = 'eryksun'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32556
    keywords = ['patch']
    message_count = 3.0
    messages = ['309990', '312578', '312585']
    nosy_count = 8.0
    nosy_names = ['paul.moore', 'vstinner', 'tim.golden', 'ezio.melotti', 'zach.ware', 'eryksun', 'steve.dower', 'miss-islington']
    pr_nums = ['5761', '5816']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue32556'
    versions = ['Python 3.7', 'Python 3.8']

    @eryksun
    Copy link
    Contributor Author

    eryksun commented Jan 15, 2018

    In bpo-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.

    @eryksun eryksun added 3.8 only security fixes stdlib Python modules in the Lib dir topic-unicode OS-windows type-feature A feature request or enhancement labels Jan 15, 2018
    @zooba zooba added the 3.7 (EOL) end of life label Feb 19, 2018
    @zooba zooba self-assigned this Feb 19, 2018
    @zooba
    Copy link
    Member

    zooba commented Feb 22, 2018

    New changeset 23ad6d0 by Steve Dower in branch 'master':
    bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now correctly convert from bytes. (GH-5761)
    23ad6d0

    @miss-islington
    Copy link
    Contributor

    New changeset 01dd52f by Miss Islington (bot) in branch '3.7':
    bpo-32556: nt._getfinalpathname, nt._getvolumepathname and nt._getdiskusage now correctly convert from bytes. (GH-5761)
    01dd52f

    @zooba zooba closed this as completed Sep 21, 2018
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes OS-windows stdlib Python modules in the Lib dir topic-unicode type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants