Package: python-moinmoin
Version: 1.9.1-1
Severity: important
Tags: patch

Hi Jonas,

when xapian is used for indexing/searching contents in the wiki, the
request may end in a NameError, for example when a pdf file should be
attached to a wiki page (see attached python traceback).

As Franklin already pointed out in bug#565854, MoinMoin/util/Subprocess.py
has to be patched, in order to solve this issue.
The attached patch, from the upstream repo, solves this issue.

BTW: Thanks for providing the python-xappy package. :-)


Regards,
Pascal

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing'), (50, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-trunk-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages python-moinmoin depends on:
ii  python                      2.5.4-5      An interactive high-level object-o
ii  python-parsedatetime        0.8.7-1      Python module to parse human-reada
ii  python-pygments             1.2.2+dfsg-1 syntax highlighting package writte
ii  python-support              1.0.6        automated rebuilding support for P
ii  python-werkzeug             0.5.1-1      collection of utilities for WSGI a

Versions of packages python-moinmoin recommends:
pn  fckeditor                     <none>     (no description available)
ii  postfix [mail-transport-agent 2.6.5-3    High-performance mail transport ag
ii  python-xapian                 1.0.17-1   Xapian search engine interface for
ii  python-xappy                  0.5-2      easy-to-use interface to the Xapia

Versions of packages python-moinmoin suggests:
pn  antiword                  <none>         (no description available)
ii  apache2                   2.2.14-5       Apache HTTP Server metapackage
ii  apache2-mpm-worker [httpd 2.2.14-5       Apache HTTP Server - high speed th
pn  catdoc                    <none>         (no description available)
pn  docbook-dsssl             <none>         (no description available)
ii  miscfiles [wordlist]      1.4.2.dfsg.1-9 Dictionaries and other interesting
ii  poppler-utils [xpdf-utils 0.12.2-2       PDF utilitites (based on libpopple
pn  python-4suite-xml         <none>         (no description available)
ii  python-docutils           0.6-3          utilities for the documentation of
pn  python-flup               <none>         (no description available)
pn  python-gdchart            <none>         (no description available)
pn  python-ldap               <none>         (no description available)
ii  python-mysqldb            1.2.2-10       A Python interface to MySQL
pn  python-openid             <none>         (no description available)
pn  python-pyxmpp             <none>         (no description available)
ii  python-tz                 2009u-1        Python version of the Olson timezo
pn  python-xml                <none>         (no description available)
pn  smbfs                     <none>         (no description available)
ii  wamerican-huge [wordlist] 6-3            American English dictionary words 
ii  wngerman [wordlist]       20091006-3     New German orthography wordlist

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/share/pyshared/MoinMoin/util/SubProcess.py (from 
python-moinmoin package)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1] mod_wsgi (pid=20448): 
Exception occurred processing WSGI script 
'/srv/www/wiki.example.com/path/to/moin.wsgi'.
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1] Traceback (most recent 
call last):
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/werkzeug/utils.py", line 248, in __call__
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     return 
self.app(environ, start_response)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/wsgiapp.py", line 281, in __call__
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     response = run(context)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/wsgiapp.py", line 88, in run
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     response = 
dispatch(request, context, action_name)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/wsgiapp.py", line 136, in dispatch
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     response = 
handle_action(context, pagename, action_name)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/wsgiapp.py", line 195, in handle_action
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     
handler(context.page.page_name, context)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/action/AttachFile.py", line 506, in 
execute
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     msg = 
handler(pagename, request)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/action/AttachFile.py", line 570, in 
_do_upload
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     target, bytes = 
add_attachment(request, pagename, target, file_upload.stream, 
overwrite=overwrite)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/action/AttachFile.py", line 226, in 
add_attachment
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     send_event(event)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/events/__init__.py", line 257, in 
send_event
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     retval = handle(event)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/events/xapian_index.py", line 81, in 
handle
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     
handle_attachment_change(event)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/events/xapian_index.py", line 68, in 
handle_attachment_change
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     
index.update_item(event.pagename, event.filename)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/search/builtin.py", line 147, in 
update_item
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     
self.do_queued_updates()
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/search/Xapian/indexing.py", line 218, in 
do_queued_updates
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     
self._index_attachment(request, connection, pagename, attachmentname, 
mode='update')
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/search/Xapian/indexing.py", line 467, in 
_index_attachment
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     mimetype, att_content 
= self.contentfilter(filename)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/search/builtin.py", line 203, in 
contentfilter
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     data = execute(self, 
filename)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/filter/application_pdf.py", line 20, in 
execute
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     return 
execfilter("pdftotext -q -enc UTF-8 %s -", filename)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/filter/__init__.py", line 44, in 
execfilter
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     data, errors, rc = 
exec_cmd(filter_cmd, timeout=300)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/util/SubProcess.py", line 235, in 
exec_cmd
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     data, errors = 
p.communicate(input, timeout=timeout)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/util/SubProcess.py", line 88, in 
communicate
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     return 
self._communicate(input)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]   File 
"/usr/lib/pymodules/python2.5/MoinMoin/util/SubProcess.py", line 170, in 
_communicate
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1]     rlist, wlist, xlist = 
select.select(read_set, write_set, [], timeout)
[Mon Jan 25 18:14:46 2010] [error] [client 10.1.1.1] NameError: global name 
'timeout' is not defined
# HG changeset patch
# User Thomas Waldmann <tw AT waldmann-edv DOT de>
# Date 1263941977 -3600
# Node ID 3e6b8234861cbbbec3028552eff2c888ad669882
# Parent  9652b2e16a10611478fdb1215bffcc43d56be60f
partially revert 0dd02729b3b5 (self.timeout related changes caused 
AttributeError)

diff -r 9652b2e16a10 -r 3e6b8234861c MoinMoin/util/SubProcess.py
--- a/MoinMoin/util/SubProcess.py       Tue Jan 19 00:46:31 2010 +0100
+++ b/MoinMoin/util/SubProcess.py       Tue Jan 19 23:59:37 2010 +0100
@@ -67,6 +67,8 @@
 
         communicate() returns a tuple (stdout, stderr)."""
 
+        self.timeout = timeout
+
         # Optimization: If we are only using one pipe, or no pipe at
         # all, using select() or threads is unnecessary.
         if [self.stdin, self.stdout, self.stderr].count(None) >= 2:
@@ -111,9 +113,9 @@
                 self.stdin.close()
 
             if self.stdout:
-                stdout_thread.join(timeout)
+                stdout_thread.join(self.timeout)
             if self.stderr:
-                stderr_thread.join(timeout)
+                stderr_thread.join(self.timeout)
 
             # if the threads are still alive, that means the thread join timed 
out
             timed_out = (self.stdout and stdout_thread.isAlive() or
@@ -167,7 +169,7 @@
             input_offset = 0
             while read_set or write_set:
                 try:
-                    rlist, wlist, xlist = select.select(read_set, write_set, 
[], timeout)
+                    rlist, wlist, xlist = select.select(read_set, write_set, 
[], self.timeout)
                 except select.error, e:
                     if e.args[0] == errno.EINTR:
                         continue

Reply via email to