librelist archives

« back to archive

Couple of typo fixes for lamson/queue.py

Couple of typo fixes for lamson/queue.py

From:
Pascal Hakim
Date:
2009-10-09 @ 01:42
Hi folks,

Ran into these while processing some emails that appear to have some
encoding issues.

Hope that helps.

Pasc

Re: Couple of typo fixes for lamson/queue.py

From:
Zed A. Shaw
Date:
2009-10-09 @ 01:54
On Fri, Oct 09, 2009 at 12:42:13PM +1100, Pascal Hakim wrote:
> Hi folks,
> 
> Ran into these while processing some emails that appear to have some
> encoding issues.
> 
> Hope that helps.

Ah crap, thanks.  Yeah, for some reason the coverage module stopped
working so I didn't notice the lack of coverage.  Thanks for the fix.


-- 
Zed A. Shaw
http://zedshaw.com/

Re: Couple of typo fixes for lamson/queue.py

From:
Pascal Hakim
Date:
2009-10-09 @ 02:17
On Thu, Oct 08, 2009 at 06:54:07PM -0700, Zed A. Shaw wrote:
> On Fri, Oct 09, 2009 at 12:42:13PM +1100, Pascal Hakim wrote:
> > Hi folks,
> > 
> > Ran into these while processing some emails that appear to have some
> > encoding issues.
> > 
> > Hope that helps.
> 
> Ah crap, thanks.  Yeah, for some reason the coverage module stopped
> working so I didn't notice the lack of coverage.  Thanks for the fix.
> 

Thank you! you've done all the work here...
 
I think there may also be a bug in the queue processing code. In
lamson/server.py from line 205...
 
It doesn't check for errors in the inner loop, so if a message fails at
that stage, the queue processor dies. If you try to restart it, it will
try to read that message again, detect the error, then try to process
it anyway.
 
Am I reading this wrong?
 
Cheers,
 
Pasc

Re: Couple of typo fixes for lamson/queue.py

From:
Pascal Hakim
Date:
2009-10-09 @ 05:01
On Fri, Oct 09, 2009 at 01:17:55PM +1100, Pascal Hakim wrote:
> On Thu, Oct 08, 2009 at 06:54:07PM -0700, Zed A. Shaw wrote:
> > On Fri, Oct 09, 2009 at 12:42:13PM +1100, Pascal Hakim wrote:
> > > Hi folks,
> > > 
> > > Ran into these while processing some emails that appear to have some
> > > encoding issues.
> > > 
> > > Hope that helps.
> > 
> > Ah crap, thanks.  Yeah, for some reason the coverage module stopped
> > working so I didn't notice the lack of coverage.  Thanks for the fix.
> > 
> 
> Thank you! you've done all the work here...
>  
> I think there may also be a bug in the queue processing code. In
> lamson/server.py from line 205...
>  
> It doesn't check for errors in the inner loop, so if a message fails at
> that stage, the queue processor dies. If you try to restart it, it will
> try to read that message again, detect the error, then try to process
> it anyway.
>  
> Am I reading this wrong?

I've attached the patch I used to solve my problem, which explains it a
little better.

I'm not convinced it's the best solution, but it might be ok as a first
round of change.

Note that it checks for exit conditions when something's gone wrong,
which can probably be considered a bug (useful for testing though ;-)


Pasc