Description
Attempting to upload an attachment to a mod_python-based moin 1.7.0 wiki results in a traceback and a zero byte attachment uploaded. I have another moin 1.7.0 wiki using mod_fcgid that does not have this problem.
Having said that, the working one is using python 2.5.1 on Fedora 9 and the broken one is using python 2.4.3 on CentOS 5, so that may be the underlying cause.
Steps to reproduce
I'm using a fairly basic apache+mod_python config:
Alias /moin_static170 "/usr/share/moin/htdocs/" <Directory "/usr/share/moin/htdocs/"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 year" </IfModule> </Directory> <Location /vwiki> SetHandler python-program PythonPath "['/srv/www/mywiki/cgi-bin'] + sys.path" PythonHandler MoinMoin.request.request_modpython::Request.run </Location>
- Try to upload an attachment to any page.
- Traceback appears.
- Resulting attachment is zero bytes.
Component selection
- general
Details
Workaround
- use mod_wsgi (== the better mod_python alternative)
- or any other request method
Discussion
Strange, the traceback shows a close file (== the uploaded file) at a place where it rather expected an open file!? I guess we need more infos about how it is expected to work (or a mod_python user debugging it).
2008-07-07, TobinCataldo - I am getting the same I/O error on closed file when attempting an attachment:
MoinMoin 1.7.0
- mod_python 3.3.1
- Python 2.5.1
- Windows Server 2003
It seems that after "args" is returned from request.request_modpython.Request._setup_args_from_cgi_form() it closes the file. Just before the return of decodeArgs() the file is open, but when it's put into postargs in request.setup_args() it's closed. It's failing returning an open file descriptor.
2008-07-11, MattMagin - I too am getting the same I/O error.
MoinMoin 1.7.0
- mod_python 3.3.1
- Python 2.5
- Debian Etch
2008-07-11, AdrianRibao - I too am getting the same I/O error.
MoinMoin 1.7.0
- mod_python 3.3.1
- Python 2.5
- Debian Lenny
2008-07-21, PaulHowarth - workaround as found in MoinMoin 1.7.1 seems to work for me
MoinMoin 1.7.1
mod_python 3.2.8 (note that the problem existed here, and I am not running mod_python 3.3.1)
- Python 2.4.3
- CentOS 5.2
2008-08-04, RomanLevitsky - workaround works for me.
- moinmoin 1.7.0
- mod_python 3.3.1 and 3.3.1_1
- Python 2.5.2
- FreeBSD 7.0
And please how can I regenerate those "request_modpython.pyc" and "request_modpython.pyo" files (I has to delete them to get new request_modpython.py file worked) ?
You should restart the daemon process
What you mean by "daemon process"? Moinmoin is running by apache with mod_python, and I already have restarted apache.
It's solved, by enabling web server write to that directory.
Plan
- Priority:
- Assigned to:
Status: bug seems to be in mod_python 3.3.1, did a workaround (please test): http://hg.moinmo.in/moin/1.7/rev/c4cf4327c96e
Please switch to mod_wsgi as soon as possible.