New submission from Ben Ma: >>> import ntpath >>> ntpath.splitdrive(None) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "E:\python3\lib\ntpath.py", line 159, in splitdrive if p and len(p) > 1: TypeError: object of type 'NoneType' has no len()
Solution: (that I've found) Lib/ntpath.py #in function splitdrive ... empty = _get_empty(p) +++ if p and len(p) > 1: --- if len(p) > 1: sep = _get_sep(p) ... return p[:2], p[2:] +++ else: +++ p = '' return empty, p ... ---------- components: Library (Lib) messages: 217077 nosy: runapp priority: normal severity: normal status: open title: ntpath.splitdrive fails on None argument type: crash versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21336> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com