= 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 == ## Describe the steps needed to reproduce the bug. If we can't reproduce it, we probably can't fix it. I'm using a fairly basic `apache`+`mod_python` config: {{{ Alias /moin_static170 "/usr/share/moin/htdocs/" Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all ExpiresActive On ExpiresDefault "access plus 1 year" SetHandler python-program PythonPath "['/srv/www/mywiki/cgi-bin'] + sys.path" PythonHandler MoinMoin.request.request_modpython::Request.run }}} 1. Try to upload an attachment to any page. 1. Traceback appears. 1. Resulting attachment is zero bytes. == Component selection == ## Where you think is this bug happening ? (general, plugin [plugin name], theme [theme name], ... * general == Details == [[attachment:traceback.html]] == Workaround == ## How to deal with the bug until it is fixed * 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: 1. !MoinMoin 1.7.0 1. mod_python 3.3.1 1. Python 2.5.1 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. 1. !MoinMoin 1.7.0 1. mod_python 3.3.1 1. Python 2.5 1. Debian Etch '''2008-07-11''', AdrianRibao - I too am getting the same I/O error. 1. !MoinMoin 1.7.0 1. mod_python 3.3.1 1. Python 2.5 1. Debian Lenny '''2008-07-21''', PaulHowarth - workaround as found in !MoinMoin 1.7.1 seems to work for me 1. !MoinMoin 1.7.1 1. mod_python 3.2.8 (note that the problem existed here, and I am ''not'' running mod_python 3.3.1) 1. Python 2.4.3 1. CentOS 5.2 '''2008-08-04''', RomanLevitsky - workaround works for me. 1. moinmoin 1.7.0 1. mod_python 3.3.1 and 3.3.1_1 1. Python 2.5.2 1. 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 = ## This part is for Moin``Moin developers: * 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. (!) ---- ## If you are a moin core developer, replace the category to Category* in these cases: ## Category MoinMoinNoBug - if this is not a bug. ## Category MoinMoinBugConfirmed - if you can confirm the bug on current code. ## Category MoinMoinBugFixed - after the bug is fixed in current code. CategoryMoinMoinBugFixed