<p dir="ltr">Appreciate the advice, I have to admit that these edge cases seem rare enough that they haven't been a priority for me (I'm still trying to wrap up a release that doesn't occasionally break the parser for certain strings on the 29th-31st of every month, for example).</p>
<p dir="ltr">Much to think about hate, I like that zdump idea as a method for test discovery.</p>
<div class="gmail_quote">On Sep 18, 2015 3:01 PM, "Tim Peters" <<a href="mailto:tim.peters@gmail.com">tim.peters@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[Alex]<br>
> ...<br>
> I suspect dateutil has problems that are not limited to ambiguous<br>
> datetimes in some IANA time zones.<br>
<br>
For pytz, Stuart said he ran zdump across all zones in the database,<br>
to drive exhaustive tests of all transition instants in every zone.<br>
That's an excellent idea :-)<br>
<br>
I strongly suspect dateutil will get some cases wrong simply because<br>
it's paying attention to the gmt/std/wall indicators in tzfiles.<br>
Those have no meaning for anything a tzinfo is trying to accomplish -<br>
it's an "attractive nuisance" that they're even stored in a tzfile.<br>
To convert transition times from UTC to local times (as dateutil<br>
appears to want to do), it should simply add the current total UTC<br>
offset, ignoring the gmt/std/wall indicators entirely.  All transition<br>
times in tzfiles are recorded in UTC, regardless of what the<br>
gmt/std/wall indicators say.<br>
<br>
That won't make any difference for "most" zones because it just so<br>
happens that the "wall" indicator is set for most transitions and the<br>
"std" indicator is not (reflecting that most zoneinfo _source_ files<br>
record DST transition points in local wall-clock time).  An exhaustive<br>
test would stumble into the exceptions.  The way to fix broken cases<br>
discovered this way is to just ignore gmt/std/wall (better, seek over<br>
'em when reading the file - they're useless).<br>
</blockquote></div>