[issue8097] bug in modulefinder: import_hook() got an unexpected keyword argument 'level'

Andreas Pfeiffer report at bugs.python.org
Tue Mar 9 11:27:39 CET 2010


New submission from Andreas Pfeiffer <andreas.pfeiffer at cern.ch>:

Hi,

  the attached file (moduleFinderBug.py) crashes in python 2.6 on
linux (RedHat EL 5) and Mac OS X (10.6) with the traceback below.

A possible fix for this would be in modulefinder.py:
323c323
<             self.import_hook(name, caller, level=level)
---
>             self.import_hook(name, caller=caller, level=level)

Please let me know if you need any further information.

Thanks,
   cheers, andreas



$> python moduleFinderBug.py
Traceback (most recent call last):
  File "work/cms/moduleFinderBug.py", line 17, in <module>
    modulefinder.run_script(filename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/modulefinder.py", line 114, in run_script
    self.load_module('__main__', fp, pathname, stuff)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/modulefinder.py", line 305, in load_module
    self.scan_code(co, m)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/modulefinder.py", line 414, in scan_code
    self._safe_import_hook(name, m, fromlist, level=level)
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/modulefinder.py", line 323, in _safe_import_hook
    self.import_hook(name, caller, level=level)
TypeError: import_hook() got an unexpected keyword argument 'level'

----------
components: Extension Modules
files: moduleFinderBug.py
messages: 100711
nosy: andreas
severity: normal
status: open
title: bug in modulefinder: import_hook() got an unexpected keyword argument 'level'
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file16509/moduleFinderBug.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8097>
_______________________________________


More information about the Python-bugs-list mailing list