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

zipfile.Path.parent returns incorrect value (same as self) for directory ref #81701

Closed
jaraco opened this issue Jul 7, 2019 · 3 comments
Closed
Labels
3.8 only security fixes stdlib Python modules in the Lib dir

Comments

@jaraco
Copy link
Member

jaraco commented Jul 7, 2019

BPO 37520
Nosy @jaraco
PRs
  • bpo-37520: Correct behavior for zipfile.Path.parent #14638
  • [3.8] bpo-37520: Correct behavior for zipfile.Path.parent (GH-14638) #14641
  • 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 = None
    closed_at = <Date 2019-07-07.22:07:48.584>
    created_at = <Date 2019-07-07.20:54:03.591>
    labels = ['3.8', 'library']
    title = 'zipfile.Path.parent returns incorrect value (same as self) for directory ref'
    updated_at = <Date 2019-07-07.22:07:48.584>
    user = 'https://github.com/jaraco'

    bugs.python.org fields:

    activity = <Date 2019-07-07.22:07:48.584>
    actor = 'jaraco'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-07-07.22:07:48.584>
    closer = 'jaraco'
    components = ['Library (Lib)']
    creation = <Date 2019-07-07.20:54:03.591>
    creator = 'jaraco'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 37520
    keywords = ['patch']
    message_count = 3.0
    messages = ['347479', '347480', '347481']
    nosy_count = 1.0
    nosy_names = ['jaraco']
    pr_nums = ['14638', '14641']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue37520'
    versions = ['Python 3.8']

    @jaraco
    Copy link
    Member Author

    jaraco commented Jul 7, 2019

    Originally reported in jaraco/zipp#7, the parent of a Path object referencing a directory is returning the incorrect result:

    cpython master $ docker run -it python:rc-buster                                                                                             
    Python 3.8.0b1 (default, Jun 27 2019, 22:38:51) 
    [GCC 8.3.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import zipfile
    >>> import io
    >>> zf = zipfile.ZipFile(io.BytesIO(), 'w')
    >>> p = zipfile.Path(zf)
    >>> p.joinpath('missing/').parent
    Path(None, 'missing/')
    >>> p.joinpath('missing/').parent.at
    'missing/'

    The expected value is '' as the parent of a single-level directory is the parent directory.

    @jaraco jaraco added 3.8 only security fixes stdlib Python modules in the Lib dir labels Jul 7, 2019
    @jaraco
    Copy link
    Member Author

    jaraco commented Jul 7, 2019

    New changeset 38f44b4 by Jason R. Coombs in branch 'master':
    bpo-37520: Correct behavior for zipfile.Path.parent (GH-14638)
    38f44b4

    @jaraco
    Copy link
    Member Author

    jaraco commented Jul 7, 2019

    New changeset 66905d1 by Jason R. Coombs (Miss Islington (bot)) in branch '3.8':
    bpo-37520: Correct behavior for zipfile.Path.parent (GH-14638) (GH-14641)
    66905d1

    @jaraco jaraco closed this as completed Jul 7, 2019
    @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.8 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant