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

Update os.path documentation regarding recommended types #82849

Closed
lazka mannequin opened this issue Nov 2, 2019 · 2 comments
Closed

Update os.path documentation regarding recommended types #82849

lazka mannequin opened this issue Nov 2, 2019 · 2 comments
Labels
3.9 only security fixes docs Documentation in the Doc dir

Comments

@lazka
Copy link
Mannequin

lazka mannequin commented Nov 2, 2019

BPO 38668
Nosy @lazka, @jdevries3133
PRs
  • gh-82849: revise intro to os.path.rst #32232
  • 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 = None
    created_at = <Date 2019-11-02.17:41:04.658>
    labels = ['3.9', 'docs']
    title = 'Update os.path documentation regarding recommended types'
    updated_at = <Date 2022-04-01.13:31:49.156>
    user = 'https://github.com/lazka'

    bugs.python.org fields:

    activity = <Date 2022-04-01.13:31:49.156>
    actor = 'jack__d'
    assignee = 'docs@python'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation']
    creation = <Date 2019-11-02.17:41:04.658>
    creator = 'lazka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38668
    keywords = ['patch']
    message_count = 1.0
    messages = ['355878']
    nosy_count = 3.0
    nosy_names = ['docs@python', 'lazka', 'jack__d']
    pr_nums = ['32232']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue38668'
    versions = ['Python 3.9']

    @lazka
    Copy link
    Mannequin Author

    lazka mannequin commented Nov 2, 2019

    At the very top of https://docs.python.org/3.9/library/os.path.html there is this section regarding str and bytes:

    The path parameters can be passed as either strings, or bytes.

    They also accept path-like since Python 3.6, see https://www.python.org/dev/peps/pep-0519/ (Adding a file system path protocol). I'd add path-like to the list.

    Unfortunately, some file names may not be representable as strings on Unix, so applications that need to support arbitrary file names on Unix should use bytes objects to represent path names.

    This is no longer true since Python 3.1 and https://www.python.org/dev/peps/pep-0383/ (Non-decodable Bytes in System Character Interfaces). I'd suggest to delete this.

    Vice versa, using bytes objects cannot represent all file names on Windows (in the standard mbcs encoding), hence Windows applications should use string objects to access all files.

    This is no longer true since Python 3.6 and https://www.python.org/dev/peps/pep-0529/ (Change Windows filesystem encoding to UTF-8). I'd suggest to delete this as well.

    @lazka lazka mannequin added the 3.9 only security fixes label Nov 2, 2019
    @lazka lazka mannequin assigned docspython Nov 2, 2019
    @lazka lazka mannequin added the docs Documentation in the Doc dir label Nov 2, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    JelleZijlstra added a commit that referenced this issue Apr 16, 2022
    * revise the first paragraph of docs for os.path
    * add a mention of `os.PathLike` protocol
    * remove warnings rendered irrelevant by :pep:`383` and :pep:`529`
    
    Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
    miss-islington pushed a commit to miss-islington/cpython that referenced this issue Apr 16, 2022
    * revise the first paragraph of docs for os.path
    * add a mention of `os.PathLike` protocol
    * remove warnings rendered irrelevant by :pep:`383` and :pep:`529`
    
    Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
    (cherry picked from commit 468314c)
    
    Co-authored-by: Jack DeVries <jdevries3133@gmail.com>
    miss-islington added a commit that referenced this issue Apr 16, 2022
    * revise the first paragraph of docs for os.path
    * add a mention of `os.PathLike` protocol
    * remove warnings rendered irrelevant by :pep:`383` and :pep:`529`
    
    Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
    (cherry picked from commit 468314c)
    
    Co-authored-by: Jack DeVries <jdevries3133@gmail.com>
    miss-islington added a commit that referenced this issue Apr 16, 2022
    * revise the first paragraph of docs for os.path
    * add a mention of `os.PathLike` protocol
    * remove warnings rendered irrelevant by :pep:`383` and :pep:`529`
    
    Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
    (cherry picked from commit 468314c)
    
    Co-authored-by: Jack DeVries <jdevries3133@gmail.com>
    @hauntsaninja
    Copy link
    Contributor

    Thanks, looks like changes have been made

    hello-adam pushed a commit to hello-adam/cpython that referenced this issue Jun 2, 2022
    * revise the first paragraph of docs for os.path
    * add a mention of `os.PathLike` protocol
    * remove warnings rendered irrelevant by :pep:`383` and :pep:`529`
    
    Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
    (cherry picked from commit 468314c)
    
    Co-authored-by: Jack DeVries <jdevries3133@gmail.com>
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant