[Mailman-Developers] Patch for HyperArch

Sebastian Hagedorn Hagedorn at uni-koeln.de
Thu Mar 10 06:19:58 EST 2016


--On 9. März 2016 um 15:15:20 -0800 Mark Sapiro <mark at msapiro.net> wrote:

>> We played around and found that the error is related to our version of
>> Python. Here's a minimal test script that shows the issue:
>>
>> from email.Utils import parseaddr, parsedate_tz, mktime_tz, formatdate
>> print mktime_tz(parsedate_tz("Fri, 4 Feb 100 00:51:42 +0100 (MET)"));
>>
>> That's the Date header from the single piece of legitimate mail. Python
>> 2.4 throws the same exception you were seeing: "ValueError: year out of
>> range". However, our Python 2.7 (which we use for Mailman) does this:
>>
>> -59008522098
>>
>> When that value is then passed to time.ctime(), you get "ValueError:
>> timestamp out of range for platform time_t". We're on RHEL 5, and our
>> version of Python 2.7 is from the IUSCommunity repo:
>> python27-2.7.10-1.ius.el5. Which version of Python were you using?
>
>
> Thinking about this a bit more, I think what you say is the crux of the
> difference between yours and mine. In your Python,
> time.ctime(-59008522098) throws the ValueError, and in mine it returns a
> date string which may cause problems later on in the processing.
>
> I think the difference is not with a Python version per se, but rather
> with the underlying C environment and C library 'time' functions that
> Python was compiled with.

That makes sense.

> In any case, I think I now have enough understanding of the issue to
> work up some kind of fix that will work in both your situation and mine.
>
> Note that your original suggested patch won't solve the problem for me
> because my time.ctime(-59008522098) does not throw a ValueError.

Right. Of course I didn't know that at the time :-)

Unless you're really interested in the other differences you referred to in 
your other message, I won't bother to analyze them further. It seems clear 
to me that you have identified the main issue.

Thanks for your help!
-- 
    .:.Sebastian Hagedorn - Weyertal 121 (Gebäude 133), Zimmer 2.02.:.
                 .:.Regionales Rechenzentrum (RRZK).:.
   .:.Universität zu Köln / Cologne University - ✆ +49-221-470-89578.:.


More information about the Mailman-Developers mailing list