[Mailman-Developers] Uncaught runner exception: 'generator' object has no attribute 'insert'

Pavel Chytil paja@asp.ogi.edu
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
>