.pyc crashes, .py doesn't

David LeBlanc whisper at oz.nospamnet
Sat May 12 13:24:23 EDT 2001


In article <0IZJ6.6795$vg1.546865 at www.newsranger.com>, 
cbrand at operamail.com says...
> I am building a CGI application with Python (2.0) for Win32 that uses an
> Access97 database via Mark Hammond's odbc module.
> 
> The program is comprised of a .cgi file and a number of Python modules.  One
> core module (whizdb.py) is the source of the problem.  It is imported into a
> much smaller 'scripting' module to provide database functionality.
> 
> The application runs just fine if I change the source file (whizdb.py) or delete
> the bytecode file (whizdb.pyc), but crashes with an invalid page fault in
> MSVCRT.DLL (MS VC++ runtime, I think) if whizdb.pyc is accessed for the import.
> 
> I expect there is a problem in my code that is causing this, but, as a
> work-around, is there a way to force Python to import from the source file (.py)
> instead of the bytecode file?  Is there a way to prevent Python from writing the
> pyc file when importing in the first place?
> 
> This has just about driven me nuts, I would appreciate any help I can get.
> Thanks.
> 
> 
> 
One thing maybe worth checking out is timing. Is it possible that you're 
not checking some return status from the (notoriously slow) access db 
that is masked by the time it takes to compile .py -> .pyc?

Just a thought...

Dave LeBlanc



More information about the Python-list mailing list