Message226644
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. |
|
Date |
User |
Action |
Args |
2014-09-09 16:24:51 | Antony.Lee | set | recipients:
+ Antony.Lee |
2014-09-09 16:24:51 | Antony.Lee | set | messageid: <1410279891.7.0.749304743952.issue22370@psf.upfronthosting.co.za> |
2014-09-09 16:24:51 | Antony.Lee | link | issue22370 messages |
2014-09-09 16:24:51 | Antony.Lee | create | |
|