AttributeError: 'generator' object has no attribute 'pop' (was: Re: [Mailman-Developers] Uncaught runner exception: 'generator' object has no attribute 'insert')
Hi Pavel, I have seen the same problem in Tagger.py (see context diff below) with incoming mails. Similar to you, I have some 2 days of Python experience, but it seems to work now. Best regards, Markus
diff -c Tagger.py.orig Tagger.py *** Tagger.py.orig Wed Nov 28 17:50:36 2001 --- Tagger.py Wed Nov 28 17:55:09 2001
*** 81,87 **** # the first numlines of body text. lines = [] lineno = 0 ! reader = email.Iterators.body_line_iterator(msg) while numlines is None or lineno < numlines: try: line = reader.pop(0) --- 81,87 ---- # the first numlines of body text. lines = [] lineno = 0 ! reader = list(email.Iterators.body_line_iterator(msg)) while numlines is None or lineno < numlines: try: line = reader.pop(0)
X-Authentication-Warning: asp.ogi.edu: nobody set sender to paja@asp.ogi.edu using -f From: Pavel Chytil <paja@asp.ogi.edu> To: "Barry A. Warsaw" <barry@zope.com> Cc: mailman-developers@python.org Subject: Re: [Mailman-Developers] Uncaught runner exception: 'generator' object has no attribute 'insert' MIME-Version: 1.0 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 4.0-cvs X-BeenThere: mailman-developers@python.org X-Mailman-Version: 2.0.7 (101270) List-Help: <mailto:mailman-developers-request@python.org?subject=help> List-Post: <mailto:mailman-developers@python.org> List-Subscribe: <http://mail.python.org/mailman/listinfo/mailman-developers>, <mailto:mailman-developers-request@python.org?subject=subscribe> List-Id: Mailman mailing list developers <mailman-developers.python.org> List-Unsubscribe: <http://mail.python.org/mailman/listinfo/mailman-developers>, <mailto:mailman-developers-request@python.org?subject=unsubscribe> List-Archive: <http://mail.python.org/pipermail/mailman-developers/> Date: Tue, 27 Nov 2001 14:03:42 -0800
Patch:
--- NewsRunner.py Tue Nov 27 13:22:45 2001 +++ NewsRunner.py Thu Oct 11 22:16:18 2001 @@ -123,7 +123,7 @@ # Lines: is useful if msg['Lines'] is None: # BAW: is there a better way? - count = len(list(email.Iterators.body_line_iterator(msg))) + count = len(email.Iterators.body_line_iterator(msg)) msg['Lines'] = str(count) # Massage the message headers by remove some and rewriting others. This # woon't completely sanitize the message, but it will eliminate the bulk
Pavel
Cituji z emailu od Pavel Chytil <pchytil@asp.ogi.edu>:
This goes away if I change
count = len(email.Iterators.body_line_iterator(msg))
to
count = len(list(email.Iterators.body_line_iterator(msg)))
in ./mailman/Mailman/Queue/NewsRunner.py line 126
I do not know if this is clean or not, but I never done anything with python.
This introduce new problem which is nntp error:
Nov 27 13:48:10 2001 (26172) (NNTPDirect) NNTP error for list "test": 441 437 No colon-space in "From pchytil@asp.ogi.edu Tue Nov 27 13:48:09 2001" header
So my hacking is still in progress. I should probably read more about format of NNTP headers in documentation of mailman.
Any ideas?
Thanks, Pavel
Cituji z emailu od Pavel Chytil <pchytil@ece.ogi.edu>:
I have the same problem like before. I am trying to gate my list with news. Posting to news does not work and gives following error:
Nov 27 11:12:30 2001 (18296) Uncaught runner exception: len() of unsized object Nov 27 11:12:30 2001 (18296) Traceback (most recent call last): File "/work/mailman/Mailman/Queue/Runner.py", line 104, in __oneloop self.__onefile(msg, msgdata) File "/work/mailman/Mailman/Queue/Runner.py", line 152, in __onefile keepqueued = self._dispose(mlist, msg, msgdata) File "/work/mailman/Mailman/Queue/NewsRunner.py", line 56, in _dispose prepare_message(mlist, msg, msgdata) File "/work/mailman/Mailman/Queue/NewsRunner.py", line 126, in prepare_message count = len(email.Iterators.body_line_iterator(msg)) TypeError: len() of unsized object
gating from news to list works fine, though. I am suspecting very similar problem as before.
Thanks, Pavel
_______________________________________________ Mailman-Developers mailing list Mailman-Developers@python.org http://mail.python.org/mailman/listinfo/mailman-developers
_______________________________________________ Mailman-Developers mailing list Mailman-Developers@python.org http://mail.python.org/mailman/listinfo/mailman-developers
_______________________________________________ Mailman-Developers mailing list Mailman-Developers@python.org http://mail.python.org/mailman/listinfo/mailman-developers
-- Markus Jansen Markus.Jansen@ericsson.com Senior Designer, Technical Coordinator Ericsson Process & Application Consulting TTM Solutions / CM Tools VH/PAC/L/TD Phone +46 8 568 61560 Västberga Allé 36A Mobile +46 70 526 2548 12582 Stockholm, Sweden Fax +46 8 568 61888
participants (1)
-
Markus Jansen