mailman.client hangs accessing moderation queue
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Postorius |
New
|
Undecided
|
Unassigned |
Bug Description
Here's what I did as recorded in Terminal.app:
steve@turnbull:
Python 2.7.3rc2 (default, Apr 22 2012, 22:30:17)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import time
>>> import subprocess
>>> from mailman.client import Client
>>> c = Client('http://
>>> dump(c.system)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'dump' is not defined
>>> c.lists
[<List "<email address hidden>">]
>>> c.domains
[<Domain "turnbull.
>>> print c.domains[
turnbull.
>>> print c.domains[
turnbull.
>>> l = c.lists[0]
>>> l.fqdn_listname
<email address hidden>'
>>> c.get_list('<email address hidden>')
<List "<email address hidden>">
>>> c.get_list(<email address hidden>')
<List "<email address hidden>">
>>> c.members
[<Member "<email address hidden>" on "<email address hidden>">]
>>> print c.members[
http://
>>> print c.members[0].link
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: '_Member' object has no attribute 'link'
>>> print c.users[0]
<User "None" (32381710049388
>>> print c.users
[<User "None" (32381710049388
>>> print c.users[
<mailman.
>>> print c.users[
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '_Addresses' object does not support indexing
>>> for a in print c.users[
File "<stdin>", line 1
for a in print c.users[
^
SyntaxError: invalid syntax
>>> for a in c.users[
... print a
...
<email address hidden>
>>> for a in sorted(l.settings):
... print a + ': ' + string(
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
NameError: name 'string' is not defined
>>> for a in sorted(l.settings):
... print a + ': ' + str(l.settings[a])
...
acceptable_aliases: []
admin_immed_notify: True
admin_notify_
administrivia: True
advertised: True
allow_list_posts: True
anonymous_list: False
autorespond_owner: none
autorespond_
autorespond_
autoresponse_
autoresponse_
autoresponse_
autoresponse_
bounces_address: <email address hidden>
collapse_
convert_
created_at: 2012-08-
default_
default_
description:
digest_
digest_
display_name: Mm3-test
filter_content: False
fqdn_listname: <email address hidden>
generic_
http_etag: "b8b4e1df6bc8d8
include_
join_address: <email address hidden>
last_post_at: None
leave_address: <email address hidden>
list_name: mm3-test
mail_host: turnbull.
next_digest_number: 1
no_reply_address: <email address hidden>
owner_address: <email address hidden>
post_id: 1
posting_address: <email address hidden>
posting_pipeline: default-
reply_goes_to_list: no_munging
request_address: <email address hidden>
scheme: http
send_welcome_
volume: 1
web_host: turnbull.
welcome_
>>> dir()
['Client', '__builtins__', '__doc__', '__name__', '__package__', 'a', 'c', 'l', 'os', 'subprocess', 'time']
>>> dir(Client)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'create_domain', 'delete_domain', 'delete_list', 'domains', 'get_domain', 'get_list', 'get_user', 'lists', 'members', 'preferences', 'system', 'users']
>>> dir(Client.system)
['__class__', '__delattr__', '__delete__', '__doc__', '__format__', '__get__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__set__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'deleter', 'fdel', 'fget', 'fset', 'getter', 'setter']
>>> dir(l)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_connection', '_get_info', '_info', '_url', 'accept_message', 'defer_message', 'delete', 'discard_message', 'display_name', 'fqdn_listname', 'get_member', 'held', 'list_name', 'mail_host', 'members', 'moderate_message', 'reject_message', 'settings', 'subscribe', 'unsubscribe']
>>> l._connection.
u'A connection to the REST client.'
>>> l.held.__doc__
^CTraceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mailman/
'lists/
File "mailman/
response, content = Http().request(url, method, data, headers)
File "/usr/lib/
(response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
File "/usr/lib/
(response, content) = self._conn_
File "/usr/lib/
response = conn.getresponse()
File "/usr/lib/
response.
File "/usr/lib/
version, status, reason = self._read_status()
File "/usr/lib/
line = self.fp.readline()
File "/usr/lib/
data = recv(1)
File "/home/
ine 226, in _enqueue
virginq.
File "/home/
, line 123, in enqueue
msgsave = cPickle.dumps(_msg, protocol)
After the above I tried a couple of things, like printing l.held (with no further attribute). These also hung for a few seconds and I interrupted with ^C.
Eventually it failed with an error about not being connected to Mailman. I thought Mailman had crashed, but when I tried shutting down Mailman using bin/mailman, it seemed to shut down normally.
Difficult to say what the cause of this could be (I could not reproduce the problem on my local machine...).
Did you take a look at mailman.log? "list.held" -requests should appear like this:
GET /<email address hidden>/held HTTP/1.1" 200
If the status is 200 there is probably something wrong inside mailman.client or httplib2.
For debugging you could also try to make the http request to the api directly without using mailman.client. It's a bit complicated from the shell though, because you have to add the auth header to the request (I'd recommend using the "requests" library for this... Makes http calls pretty painless.).