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

Clarify pathlib.Path("filepath").read_text() #78500

Closed
ApproximateIdentity mannequin opened this issue Aug 2, 2018 · 8 comments
Closed

Clarify pathlib.Path("filepath").read_text() #78500

ApproximateIdentity mannequin opened this issue Aug 2, 2018 · 8 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir

Comments

@ApproximateIdentity
Copy link
Mannequin

ApproximateIdentity mannequin commented Aug 2, 2018

BPO 34319
Nosy @terryjreedy, @ApproximateIdentity, @CuriousLearner, @miss-islington, @tirkarthi
PRs
  • bpo-34319: Clarify file handler closure in pathlib.read_text #8645
  • [3.7] bpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645) #8694
  • [3.6] bpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645) #8695
  • 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 2018-08-27.04:18:01.442>
    created_at = <Date 2018-08-02.11:52:33.845>
    labels = ['3.7', '3.8', 'docs']
    title = 'Clarify pathlib.Path("filepath").read_text()'
    updated_at = <Date 2018-08-27.04:18:01.440>
    user = 'https://github.com/ApproximateIdentity'

    bugs.python.org fields:

    activity = <Date 2018-08-27.04:18:01.440>
    actor = 'CuriousLearner'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2018-08-27.04:18:01.442>
    closer = 'CuriousLearner'
    components = ['Documentation']
    creation = <Date 2018-08-02.11:52:33.845>
    creator = 'thomas.nyberg'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34319
    keywords = ['patch']
    message_count = 8.0
    messages = ['322947', '322991', '323033', '323152', '323219', '323220', '323221', '324145']
    nosy_count = 6.0
    nosy_names = ['terry.reedy', 'docs@python', 'thomas.nyberg', 'CuriousLearner', 'miss-islington', 'xtreak']
    pr_nums = ['8645', '8694', '8695']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue34319'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    @ApproximateIdentity
    Copy link
    Mannequin Author

    ApproximateIdentity mannequin commented Aug 2, 2018

    This came out of the following posts:

    https://mail.python.org/pipermail/python-ideas/2018-August/052549.html
    https://mail.python.org/pipermail/python-ideas/2018-August/052553.html

    Basically my request would be to change the documentation here:

    https://docs.python.org/3.7/library/pathlib.html#pathlib.Path.read_text

    I would like to add a note that the underlying file object itself is closed after the read_text() method is called. Maybe I'm just a little dense and it should be obvious that the functionality here would be different than open("filepath").read(), but given that thread I linked, I don't believe I'm the only one.

    @ApproximateIdentity ApproximateIdentity mannequin added the docs Documentation in the Doc dir label Aug 2, 2018
    @terryjreedy
    Copy link
    Member

    How about if we add "The file is opened and then closed." before "The optional parameters have the same meaning as in open()."

    @terryjreedy terryjreedy added 3.7 (EOL) end of life 3.8 only security fixes labels Aug 2, 2018
    @ApproximateIdentity
    Copy link
    Mannequin Author

    ApproximateIdentity mannequin commented Aug 3, 2018

    For what it's worth as the original opener of the bug report, I think Terry's recommendation clarifies things quite well.

    @CuriousLearner
    Copy link
    Member

    +1 to Terry's suggestion.

    I've reviewed xtreak's PR and it looks good to me.

    @terryjreedy
    Copy link
    Member

    New changeset 5b2657f by Terry Jan Reedy (Xtreak) in branch 'master':
    bpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645)
    5b2657f

    @miss-islington
    Copy link
    Contributor

    New changeset 1c6df83 by Miss Islington (bot) in branch '3.7':
    bpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645)
    1c6df83

    @miss-islington
    Copy link
    Contributor

    New changeset 3da5c5c by Miss Islington (bot) in branch '3.6':
    bpo-34319: Clarify file handler closure in pathlib.read_text (GH-8645)
    3da5c5c

    @CuriousLearner
    Copy link
    Member

    Marking this bug as fixed via #8645

    @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 docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants