[mod_python] Upload troubles in Debian

William Witteman yam at nerd.cx
Sat Jan 19 21:59:14 EST 2008


I have a server running Debian stable, and I am new to mod_python and
trying to get file uploads handled under the publisher handler.

Here's the test code:

#!/usr/bin/python

html = """
<html><body>
<form action="upload" method="POST" enctype="multipart/form-data">
  <input type="file" name="fileupload"/>
  <input type="submit" value="Upload!">
</form>
</body></html>
"""

def index(req):
    return html

def upload(req):
    fp = req.form['fileupload'].file
    return type(fp)


Here's the error:

Mod_python error: "PythonHandler mod_python.publisher"

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
    result = object(req)

  File "/usr/lib/python2.4/site-packages/mod_python/publisher.py", line 213, in handler
    published = publish_object(req, object)

  File "/usr/lib/python2.4/site-packages/mod_python/publisher.py", line 412, in publish_object
    return publish_object(req,util.apply_fs_data(object, req.form, req=req))

  File "/usr/lib/python2.4/site-packages/mod_python/publisher.py", line 412, in publish_object
    return publish_object(req,util.apply_fs_data(object, req.form, req=req))

  File "/usr/lib/python2.4/site-packages/mod_python/util.py", line 401, in apply_fs_data
    fc = object.__init__.im_func.func_code

AttributeError: 'wrapper_descriptor' object has no attribute 'im_func'

I'm not sure what to try next.  Any help would be appreciated.  Thanks.
-- 

yours,

William


More information about the Mod_python mailing list