[mod_python] Re: Mike's psp upload

Daniel Nogradi nogradi at gmail.com
Mon Feb 20 19:05:16 EST 2006

> Hmm. I tested and indeed, the program does not work any more.
> The problem is NOT that FileCounter does not supply a read() method though.
> There's no reason for
> any object to 'read' the file, it's just writing it.

Well, here is the traceback that I get:

Mod_python error: "PythonHandler mod_python.psp"

Traceback (most recent call last):

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

  File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 302,
in handler

  File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 213, in run
    exec code in global_scope

  File "/var/www/html/psp/upload.psp", line 43, in ?
    for afile in frm.getlist('archivefile'):

  File "/usr/lib/python2.3/site-packages/mod_python/util.py", line
354, in getlist

  File "/usr/lib/python2.3/site-packages/mod_python/util.py", line 74,
in __getattr__
    value = self.file.read()

AttributeError: FileCounter instance has no attribute 'read'

That seems pretty clear about a required 'read' method in util.py.

> (Oh, and remove the reference to 'fmt.py' which I forgot to strip out)

Yes of course, I removed that.

More information about the Mod_python mailing list