Message1119
Under jython 2.2 (latest and previous build) attempting to access
specifically the __doc__ attribute of objects of built in classes fails.
The example uses "dict" but the bug is not specific to this.
Other classes may also be affected. The behavior was first seen
introspecting the on an object of the PatternObject class in the re
module.
E.g.
>>> d = dict()
>>> dir(d)
['__class__', '__cmp__', '__contains__', '__delattr__', '__delitem__',
'__doc__', '__eq__', '__getattribute__', '__getitem__', '__hash__', '__init__',
'__iter__', '__len__', '__ne__', '__new__', '__repr__', '__setattr__',
'__setitem__', '__str__', '__unicode__', 'clear', 'copy', 'fromkeys', 'get',
'has_key', 'items', 'iteritems', 'iterkeys', 'itervalues', 'keys', 'pop',
'popitem', 'setdefault', 'update', 'values']
>>> d.__class__
<type 'dict'>
>>> d.__doc__
Traceback (innermost last):
File "<console>", line 1, in ?
java.lang.NullPointerException
at org.python.core.PyObject.getDoc(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorIm
pl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc
cessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.python.core.PyGetSetDescr.__get__(Unknown Source)
at org.python.core.PyObject.object___findattr__(Unknown Source)
at org.python.core.PyObject.__findattr__(Unknown Source)
at org.python.core.PyObject.__getattr__(Unknown Source)
at org.python.pycode._pyx11.f$0(<console>:1)
at org.python.pycode._pyx11.call_function(<console>)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyCode.call(Unknown Source)
at org.python.core.Py.runCode(Unknown Source)
at org.python.core.Py.exec(Unknown Source)
at org.python.util.PythonInterpreter.exec(Unknown Source)
at org.python.util.InteractiveInterpreter.runcode(Unknown Source)
at org.python.util.InteractiveInterpreter.runsource(Unknown
Source)
at org.python.util.InteractiveInterpreter.runsource(Unknown
Source)
at org.python.util.InteractiveConsole.push(Unknown Source)
at org.python.util.InteractiveConsole.interact(Unknown Source)
at org.python.util.jython.main(Unknown Source)
java.lang.NullPointerException: java.lang.NullPointerException |
|
Date |
User |
Action |
Args |
2008-02-20 17:17:28 | admin | link | issue1462188 messages |
2008-02-20 17:17:28 | admin | create | |
|