[issue21336] ntpath.splitdrive fails on None argument
Eric V. Smith added the comment: I'm going to close this as not a bug. Feel free to reopen it if there's use case for passing in None. -- resolution: - not a bug stage: - resolved status: open - closed ___ 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
[issue21336] ntpath.splitdrive fails on None argument
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
[issue21336] ntpath.splitdrive fails on None argument
Eric V. Smith added the comment: Why are you passing None, and what would you expect the result to be? The function is documented as taking a string. -- nosy: +eric.smith type: crash - behavior ___ 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