469,903 Members | 1,705 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,903 developers. It's quick & easy.

Can anyone confirm this modulefinder bug?

- 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
Jul 18 '05 #1
3 1289
"Roger Binns" <ro****@rogerbinns.com> writes:
- 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.


Yes, I can confirm this (Python 2.3+, linux x86).
The problem appears to be this:
compile("# -*- coding: mbcs -*-", "<string>", "exec") Traceback (most recent call last):
File "<stdin>", line 1, in ?
MemoryError


Thomas
Jul 18 '05 #2
Thomas Heller <th*****@python.net> writes:
"Roger Binns" <ro****@rogerbinns.com> writes:
- 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.


Yes, I can confirm this (Python 2.3+, linux x86).
The problem appears to be this:
compile("# -*- coding: mbcs -*-", "<string>", "exec") Traceback (most recent call last):
File "<stdin>", line 1, in ?
MemoryError
For Windows, it's possible to also trigger it:
compile("# -*- encoding: abc -*-", "<string>", "exec") Traceback (most recent call last):
File "<stdin>", line 1, in ?
MemoryError


Who files the bug?

Thomas
Jul 18 '05 #3
Thomas Heller wrote:
Yes, I can confirm this (Python 2.3+, linux x86).
The problem appears to be this:
> > compile("# -*- coding: mbcs -*-", "<string>", "exec")

Traceback (most recent call last):
File "<stdin>", line 1, in ?
MemoryError
> >
For Windows, it's possible to also trigger it:
compile("# -*- encoding: abc -*-", "<string>", "exec") Traceback (most recent call last):
File "<stdin>", line 1, in ?
MemoryError >


Who files the bug?


I believe Anthony Tuininga will be filing it. I originally was
using cx-Freeze on Linux and reported the issue on that mailing
list. Anthony also found it to be present in Python 2.4 CVS
and volunteered to report it.

Roger
Jul 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Logger | last post: by
1 post views Thread by freshRecruit | last post: by
2 posts views Thread by Wiktor Zychla [C# MVP] | last post: by
1 post views Thread by chris | last post: by
4 posts views Thread by tfsmag | last post: by
8 posts views Thread by rn5a | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.