[Python-bugs-list] [Bug #113693] freeze modulefinder broken
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 14 Sep 2000 05:10:18 -0700
Bug #113693, was updated on 2000-Sep-06 05:09
Here is a current snapshot of the bug.
Project: Python
Category: None
Status: Open
Resolution: None
Bug Group: None
Priority: 5
Summary: freeze modulefinder broken
Details: The following one-liner script can not be frozen:
import string
The traceback is included below. Line number are from revision 1.13 of modulefinder.py.
The problem appears to be related to recent changes to the import bytecodes
Traceback (most recent call last):
File "d:\python\tools\freeze\freeze.py", line 457, in ?
main()
File "d:\python\tools\freeze\freeze.py", line 321, in main
mf.import_hook(mod)
File "d:\python\tools\freeze\modulefinder.py", line 106, in import_hook
q, tail = self.find_head_package(parent, name)
File "d:\python\tools\freeze\modulefinder.py", line 147, in find_head_package
q = self.import_module(head, qname, parent)
File "d:\python\tools\freeze\modulefinder.py", line 233, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
File "d:\python\tools\freeze\modulefinder.py", line 261, in load_module
self.scan_code(co, m)
File "d:\python\tools\freeze\modulefinder.py", line 281, in scan_code
self.import_hook(name, m)
File "d:\python\tools\freeze\modulefinder.py", line 106, in import_hook
q, tail = self.find_head_package(parent, name)
File "d:\python\tools\freeze\modulefinder.py", line 147, in find_head_package
q = self.import_module(head, qname, parent)
File "d:\python\tools\freeze\modulefinder.py", line 233, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
File "d:\python\tools\freeze\modulefinder.py", line 261, in load_module
self.scan_code(co, m)
File "d:\python\tools\freeze\modulefinder.py", line 281, in scan_code
self.import_hook(name, m)
File "d:\python\tools\freeze\modulefinder.py", line 106, in import_hook
q, tail = self.find_head_package(parent, name)
File "d:\python\tools\freeze\modulefinder.py", line 147, in find_head_package
q = self.import_module(head, qname, parent)
File "d:\python\tools\freeze\modulefinder.py", line 233, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
File "d:\python\tools\freeze\modulefinder.py", line 261, in load_module
self.scan_code(co, m)
File "d:\python\tools\freeze\modulefinder.py", line 303, in scan_code
self.scan_code(c, m)
File "d:\python\tools\freeze\modulefinder.py", line 281, in scan_code
self.import_hook(name, m)
File "d:\python\tools\freeze\modulefinder.py", line 106, in import_hook
q, tail = self.find_head_package(parent, name)
File "d:\python\tools\freeze\modulefinder.py", line 147, in find_head_package
q = self.import_module(head, qname, parent)
File "d:\python\tools\freeze\modulefinder.py", line 233, in import_module
m = self.load_module(fqname, fp, pathname, stuff)
File "d:\python\tools\freeze\modulefinder.py", line 261, in load_module
self.scan_code(co, m)
File "d:\python\tools\freeze\modulefinder.py", line 289, in scan_code
assert lastname is not None
AssertionError
Follow-Ups:
Date: 2000-Sep-07 15:06
By: jhylton
Comment:
Please do triage on this bug.
-------------------------------------------------------
Date: 2000-Sep-14 05:10
By: jackjansen
Comment:
The problem is that the code expects IMPORT_NAME immedeately followed by
a sequence of IMPORT_FROMs. That has changed now that IMPORT_FROM
puts the result on the stack.
A fix that appears to work for me is to set lastname to None only on POP_TOP
instructions. But I'll leave doing the actual fix to someone more knowledgeable than
me on the code that from x import y can generate.
-------------------------------------------------------
For detailed info, follow this link:
http://sourceforge.net/bugs/?func=detailbug&bug_id=113693&group_id=5470