-
-
Couldn't load subscription status.
- Fork 33.3k
Open
Labels
OS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Examples below:
- \\192.168.10.2\share1 is a valid UNC.
- \\192.168.10.34534543.2\share1 is an invalid UNC as it has five IPv4 octets and an octet is out of range.
- \\"!£$£"$%\share1 is an invalid UNC as it contains illegal characters.
C:\Users\earpt\source\repos\cowgoesmoo69\cpython>python.bat
Running Debug|x64 interpreter...
Python 3.15.0a0 (heads/main:1c598e0436, Oct 10 2025, 18:08:52) [MSC v.1944 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.ismount("\\\\192.168.10.2\\share1")
True
>>> os.path.ismount("\\\\192.168.10.34534543.2\\share1")
True
>>> os.path.ismount("\\\\\"!£$£\"$%\\share1")
True
>>>It appears there is no validation in ntpath.ismount() of a path that appears to be a UNC.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
msmojtabafar
Metadata
Metadata
Assignees
Labels
OS-windowsstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error