Issue222809

classification
Title: reload fails for modules in packages
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: bckfnn
Priority: low Keywords:

Created on 2000-11-18.19:01:43 by bckfnn, last changed 2000-11-18.22:29:54 by bckfnn.

Messages
msg56 (view) Author: Finn Bock (bckfnn) Date: 2000-11-18.19:01:43
Calling reload multiple times (3 times, actually) on a module
in a package produces a traceback.

JPython 1.1beta2 on java1.2.2
Copyright (C) 1997-1999 Corporation for National Research Initiatives
>>> import package.test
test
>>> reload(package.test)
test
<module test at 6288290>
>>> reload(package.test)
>>> reload(package.test)
Traceback (innermost last):
  File "<console>", line 1, in ?
java.lang.NullPointerException
        at org.python.core.imp.reload(imp.java:509)
        at org.python.core.__builtin__.reload(__builtin__.java:677)
        at java.lang.reflect.Method.invoke(Native Method)
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java
:156)
        at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java
:164)
        at org.python.core.PyObject.__call__(PyObject.java:268)
        at org.python.pycode._pyx4.f$0(<console>)
        at org.python.pycode._pyx4.call_function(<console>)
        at org.python.core.PyTableCode.call(PyTableCode.java:75)
        at org.python.core.Py.runCode(Py.java:935)
        at org.python.core.Py.exec(Py.java:949)
        at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:122)
        at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter
.java:82)
        at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpret
er.java:63)
        at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpret
er.java:42)
        at org.python.util.InteractiveConsole.push(InteractiveConsole.java:80)
        at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:5
9)
        at org.python.util.jpython.main(jpython.java:140)
        at org.python.core.jpython.main(jpython.java:9)

java.lang.NullPointerException: java.lang.NullPointerException
>>>


source code for test.py:
-----------------------

print 'test'


Here's the same module "unpackaged" running successfully:

JPython 1.1beta2 on java1.2.2
Copyright (C) 1997-1999 Corporation for National Research Initiatives
>>> import test
test
>>> reload(test)
test
<module test at 1707132>
>>> reload(test)
test
<module test at 1707132>
>>> reload(test)
test
<module test at 1707132>
>>>


Here's the same "packaged" module running successfully in CPython:

Python 1.5.2 (#0, Apr 13 1999, 10:51:12) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import package.test
test
>>> reload(package.test)
test
<module 'package.test' from 'package\test.pyc'>
>>> reload(package.test)
test
<module 'package.test' from 'package\test.pyc'>
>>> reload(package.test)
test
<module 'package.test' from 'package\test.pyc'>
>>>
msg57 (view) Author: Finn Bock (bckfnn) Date: 2000-11-18.22:29:54
Fixed in imp.reload(PyModule m)
History
Date User Action Args
2000-11-18 19:01:43bckfnncreate