Can anyone confirm this modulefinder bug?

Roger Binns rogerb at rogerbinns.com
Wed Jun 23 09:00:27 CEST 2004


- Create foo.py

# -*- coding: mbcs -*-
"string"
var1="1.2.3.4"
var2=0x123345

- Do this at a python prompt

> > > import modulefinder
> > > m=modulefinder.ModuleFinder()
> > > m.run_script("foo.py")

You then get a traceback with a MemoryError (sorry I can't paste
the traceback due to this being via display protocol that doesn't
support the clipboard).

I get this on Linux for sure and believe it is also being seen on Mac.
The issue does not occur on Windows.

It started happening when using cx_Freeze on Linux and BundleBuilder
on Mac, and the mbcs encoded file is generated by makepy from win32all
(ie it is Python code generated from a COM type library).  Since
modulefinder parses byte codes, it ignores the fact that I only
import the file when sys.platform == "win32".

Removing the coding line doesn't result in the error any more.

Roger





More information about the Python-list mailing list