Skip to content

os.path.splitext() can split UNC drive on Windows #115892

@barneygale

Description

@barneygale

Bug report

>>> import ntpath
>>> ntpath.splitext('//server/share.jpg')
('//server/share', '.jpg')  # expected: ('//server/share.jpg', '')

This path has an empty basename, and so its suffix should also be empty. Affects all current Python versions.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13bugs and security fixesOS-windowstype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions