Skip to content

pathlib.PurePath.with_name() rejects names with NTFS alternate data streams; accepts '.' #110488

Closed

Description

@barneygale

Bug report

This shouldn't raise an exception:

>>> pathlib.PureWindowsPath('foo', 'a').with_name('a:b')
ValueError: Invalid name 'a:b'

(affects all versions of pathlib)

This should raise an exception:

>>> pathlib.PurePath('foo', 'a').with_name('.')
PurePosixPath('foo/.')

(affects 3.12 and up)

Linked PRs

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    3.11only security fixes
    3.12only security fixes
    3.13only security fixes
    on Oct 6, 2023
  2. barneygale commented on Oct 10, 2023

    @barneygale
    ContributorAuthor

    Removing the 3.11 tag as pathlib in Python 3.11 doesn't properly support NTFS alternate data streams, see #80486.

  3. added 6 commits that reference this issue on Oct 10, 2023
  4. 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

    3.12only security fixes3.13only security fixestopic-pathlibtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions