<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I definitely can't claim to be an expert on tzinfo in Python, but if we can define our own UTC timezone and have it be compatible with py3 UTC objects that seems reasonable. Are there any surprises we should be aware of?</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">-Paul</div> <br><p class="airmail_on">On November 25, 2015 at 11:27:27 AM, Erik Trauschke (<a href="mailto:erik.trauschke@gmail.com">erik.trauschke@gmail.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>As I see it this would be good practice since the timezone is properly<br>defined. I stumbled over it because the code I'm porting asserts that<br>the times we get are UTC so they can be compared correctly to the<br>current time.<br><br>I guess you could just refer to the documentation but at the moment I<br>don't think it is explicitly mentioned anyway. It just takes the<br>guesswork out.<br><br>Erik<br><br>On Wed, Nov 25, 2015 at 8:39 AM, Paul Kehrer <paul.l.kehrer@gmail.com> wrote:<br>> The documentation states that these are naïve datetimes representing UTC,<br>> but it is true that you can't tell by introspecting the object itself. Do<br>> you see a significant advantage to attaching an explicit timezone to them<br>> outside of being able to introspect the return value in a REPL and see that<br>> it's UTC?<br>><br>> -Paul<br>><br>> On November 25, 2015 at 9:57:40 AM, Erik Trauschke<br>> (erik.trauschke@gmail.com) wrote:<br>><br>> I noticed that when ever we return datetime objects which come out of<br>> backend.py`_parse_asn1_time(), they don't have a tzinfo attached.<br>><br>> Afaik, these values should always be UTC but for someone consuming<br>> just the result of not_valid_before, etc. that might not be clear. I<br>> think it should be possible to add this to _parse_asn1_time() so that<br>> we indicate that these are UTC times.<br>><br>> I know it's a bit painful in Python <3.2 because we have to implement<br>> the tzinfo class ourself but it's also not that much code.<br>><br>> Erik<br>> _______________________________________________<br>> Cryptography-dev mailing list<br>> Cryptography-dev@python.org<br>> https://mail.python.org/mailman/listinfo/cryptography-dev<br>><br>><br>> _______________________________________________<br>> Cryptography-dev mailing list<br>> Cryptography-dev@python.org<br>> https://mail.python.org/mailman/listinfo/cryptography-dev<br>><br>_______________________________________________<br>Cryptography-dev mailing list<br>Cryptography-dev@python.org<br>https://mail.python.org/mailman/listinfo/cryptography-dev<br></div></div></span></blockquote></body></html>