Skip to content

Add os.path.isreserved() function #88569

Description

@barneygale
BPO 44403
Nosy @barneygale

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 2021-06-12.19:52:47.516>
labels = ['type-feature', 'library']
title = 'Add os.path.isreserved() function'
updated_at = <Date 2021-06-12.19:52:47.516>
user = 'https://github.com/barneygale'

bugs.python.org fields:

activity = <Date 2021-06-12.19:52:47.516>
actor = 'barneygale'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-06-12.19:52:47.516>
creator = 'barneygale'
dependencies = []
files = []
hgrepos = []
issue_num = 44403
keywords = []
message_count = 1.0
messages = ['395702']
nosy_count = 1.0
nosy_names = ['barneygale']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue44403'
versions = []

Linked PRs

Activity

  1. barneygale commented on Jun 12, 2021

    barneygalemannequin
    MannequinAuthor

    Windows reserves certain filenames like 'NUL'. Checking for these names is part of a small handful of functionality that is available in pathlib but not in os.path.

    I propose that we add an os.path.isreserved() function, encorporating Eryk Sun's work on bpo-27827. We then adjust pathlib to call the new function.

    By doing so, we move one of the few remaining OS-specific implementations in pathlib to low-level libraries (posixpath, ntpath) where it arguably belongs.

    We also make this functionality available to the segment of people using traditional string-based path operations who don't want to dip their toes into pathlib just for reserved names.

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    type-featureA feature request or enhancement
    on Jun 12, 2021
  3. transferred this issue fromon Apr 10, 2022
  4. added a commit that references this issue on Jul 31, 2022
  5. added a commit that references this issue on Jan 26, 2024
  6. barneygale commented on Jan 26, 2024

    @barneygale
    ContributorAuthor

    Resolved in 3.13 / 7e31d6d / #95486

  7. added a commit that references this issue on Feb 11, 2024
  8. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions