Skip to content

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

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

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.13bugs and 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