← Back to team overview

dulwich team mailing list archive

Re: [PATCH] Use datetime.utcfromtimestamp() in tests.

 

Hi Dave,

On Fri, 2010-04-09 at 10:56 -0700, dborowitz@xxxxxxxxxx wrote:
> datetime.fromtimestamp() has the confusing behavior of treating the
> timestamp as a UTC time and then converting to local time, but not
> setting the tzinfo member. As a result, the function returns different
> values depending on the local timezone, which makes it hard to write a
> test that passes everywhere.
> 
> The output of datetime.utcfromtimestamp() is stable across all
> timezones, which is all we really need for tests. (Returning sensible
> datetime objects from the Commit/Tag API would require substantially
> more work, but that is not fixed in this change.)
Thanks! As you might've seen I hit this as well but apparently messed up
the fix. Merged into trunk.

Cheers,

Jelmer

Attachment: signature.asc
Description: This is a digitally signed message part


References