[mod_python] mod_python servlet failing on non-existent code

Gregory (Grisha) Trubetskoy grisha at modpython.org
Fri Aug 13 11:08:18 EDT 2004

On Fri, 13 Aug 2004, Chris Curvey wrote:

> I'm hacking my way through a proof-of-concept with mod_python servlets, and 
> I'm coming across something strange.  When I hit my page, I'm getting an 
> error message returned in a browser ("unpack tuple of wrong size").   The 
> strange part is that the line listed in the browser doesn't exist in my code 
> anymore.  (I changed that line as part of the debugging process.)

This is not unusual - Python caches locations of lines so when a module is 
reloaded oftentimes the traceback will refer to the source code as it was 
in the original file. The only way to get around this is to restart the 

> So I figured that maybe I was having a problem with mod_python caching 
> classes, and I restarted apache just as "httpd -X".  I hit the page again, 
> and the same error message shows up in the browser, but the HTML that I want 
> shows up in the window where I started httpd.

Are you writing your output to stdout (using "print") or stderr for some 


More information about the Mod_python mailing list