From: SourceForge.net <no...@so...> - 2006-03-31 15:42:50
|
Bugs item #1462188, was opened at 2006-03-31 10:42 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1462188&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Alex Stoddard (astoddar) Assigned to: Nobody/Anonymous (nobody) Summary: NullPointerException on accessing __doc__ attribute Initial Comment: 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 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1462188&group_id=12867 |