Message537

Author bzimmer
Recipients
Date 2001-12-20.20:47:10
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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
>>>

History
Date User Action Args
2008-02-20 17:16:59adminlinkissue495602 messages
2008-02-20 17:16:59admincreate