From: <no...@so...> - 2001-12-20 20:47:11
|
Bugs item #495602, was opened at 2001-12-20 12:47 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112867&aid=495602&group_id=12867 Category: Library Group: None Status: Open Resolution: None Priority: 5 Submitted By: brian zimmer (bzimmer) Assigned to: Nobody/Anonymous (nobody) Summary: os.path.dirname() can result in an NPE Initial Comment: os.path.dirname() does not check if the the filename is None. $ jython Jython 2.1b2 on java1.3.1 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import os.path >>> os.path.dirname(None) Traceback (innermost last): File "<console>", line 1, in ? File "c:\home\development\sourceforge\jython\Lib\javapa th.py", line 25, in dirname java.lang.NullPointerException at java.io.File.<init>(File.java:180) at java.lang.reflect.Constructor.newInstance (Native Method) at org.python.core.PyReflectedConstructor.__call__ (PyReflectedConstructor.java:126) $ python Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. >>> import os.path >>> os.path.dirname(None) Traceback (most recent call last): File "<stdin>", line 1, in ? File "c:\python\cpython\2.1\Lib\ntpath.py", line 156, in dirname return split(p)[0] File "c:\python\cpython\2.1\Lib\ntpath.py", line 105, in split d, p = splitdrive(p) File "c:\python\cpython\2.1\Lib\ntpath.py", line 60, in splitdrive if p[1:2] == ':': TypeError: unsliceable object >>> ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=112867&aid=495602&group_id=12867 |