You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, pathlib contains the following check for the OS in the import section:
try:
import nt
except ImportError:
nt = None
else:
if sys.getwindowsversion()[:2] >= (6, 0):
from nt import _getfinalpathname
else:
supports_symlinks = False
_getfinalpathname = None
I would like to suggest to switch this on testing for the value of os.name (as PurePath.__new__ does), or possibly testing whether sys.getwindowsversion exists: the nt module is not publicly defined, so it wouldn't be unreasonable to have a file named nt.py on an Unix system (where this shouldn't cause any problems), in which case importing pathlib raises an AttributeError at the getwindowsversion line.
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: