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

pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist #82852

Closed
uranusjr mannequin opened this issue Nov 3, 2019 · 3 comments
Labels
3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@uranusjr
Copy link
Mannequin

uranusjr mannequin commented Nov 3, 2019

BPO 38671
Nosy @brettcannon, @pfmoore, @tjguk, @zware, @zooba, @uranusjr, @miss-islington, @carltongibson, @barneygale, @cjolowicz
PRs
  • bpo-38671: Make sure to return an absolute path in pathlib._WindowsFlavour.resolve() #17716
  • bpo-38671: Add test that pathlib.Path.resolve() returns an absolute path. #26184
  • [3.10] bpo-38671: Add test that pathlib.Path.resolve() returns an absolute path. (GH-26184) #26270
  • 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 2021-08-07.14:59:51.791>
    created_at = <Date 2019-11-03.09:55:31.070>
    labels = ['type-bug', '3.8', '3.9', '3.10', 'library', 'OS-windows']
    title = 'pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist'
    updated_at = <Date 2021-08-07.14:59:51.790>
    user = 'https://github.com/uranusjr'

    bugs.python.org fields:

    activity = <Date 2021-08-07.14:59:51.790>
    actor = 'uranusjr'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-08-07.14:59:51.791>
    closer = 'uranusjr'
    components = ['Library (Lib)', 'Windows']
    creation = <Date 2019-11-03.09:55:31.070>
    creator = 'uranusjr'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38671
    keywords = ['patch']
    message_count = 3.0
    messages = ['355892', '394108', '399190']
    nosy_count = 11.0
    nosy_names = ['brett.cannon', 'paul.moore', 'tim.golden', 'zach.ware', 'steve.dower', 'uranusjr', 'ricpol', 'miss-islington', 'carltongibson', 'barneygale', 'cjolowicz']
    pr_nums = ['17716', '26184', '26270']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue38671'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @uranusjr
    Copy link
    Mannequin Author

    uranusjr mannequin commented Nov 3, 2019

    Originally from https://discuss.python.org/t/pathlib-absolute-vs-resolve/2573/4

    >>> import pathlib
    >>> pathlib.Path().resolve()
    WindowsPath('C:/temp')
    >>> list(pathlib.Path().iterdir())
    []
    >>> pathlib.Path('foo').resolve()
    WindowsPath('foo')
    >>> pathlib.Path('bar').touch()
    >>> pathlib.Path('bar').resolve()
    WindowsPath('C:/temp/bar')

    @uranusjr uranusjr mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life labels Nov 3, 2019
    @uranusjr uranusjr mannequin changed the title pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not existent pathlib.Path.resolve(strict=False) returns relative path on Windows if the entry does not exist Nov 4, 2019
    @brettcannon brettcannon added the stdlib Python modules in the Lib dir label Nov 4, 2019
    @eryksun eryksun added OS-windows 3.9 only security fixes 3.10 only security fixes type-bug An unexpected behavior, bug, or error and removed 3.7 (EOL) end of life labels Mar 10, 2021
    @miss-islington
    Copy link
    Contributor

    New changeset ee51c56 by Barney Gale in branch '3.10':
    [3.10] bpo-38671: Add test that pathlib.Path.resolve() returns an absolute path. (GH-26184) (GH-26270)
    ee51c56

    @uranusjr
    Copy link
    Mannequin Author

    uranusjr mannequin commented Aug 7, 2021

    I think this can be closed now that the PRs are all merged?

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 (EOL) end of life 3.9 only security fixes 3.10 only security fixes OS-windows stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants