This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Antony.Lee
Recipients Antony.Lee
Date 2014-09-09.16:24:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1410279891.7.0.749304743952.issue22370@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-09-09 16:24:51Antony.Leesetrecipients: + Antony.Lee
2014-09-09 16:24:51Antony.Leesetmessageid: <1410279891.7.0.749304743952.issue22370@psf.upfronthosting.co.za>
2014-09-09 16:24:51Antony.Leelinkissue22370 messages
2014-09-09 16:24:51Antony.Leecreate