[issue28602] `tzinfo.fromutc()` fails when used for a fold-aware tzinfo implementation

Paul G report at bugs.python.org
Thu Nov 3 15:26:01 EDT 2016


Paul G added the comment:

Of the `tzinfo` implementations provided by `python-dateutil`, `tzrange`, `tzstr` (GNU TZ strings), `tzwin` (Windows style time zones) and `tzlocal` all satisfy this condition. These are basically all implementations of default system time zone information.

With current implementations `tzfile` and `tzical` also use the invariant algorithm, though theoretically there are edge cases where this will cause problems, and those should have their `fromutc()` adjusted.

In any case, I can't think of a single actual downside to this change - all it does is preserve the original behavior of `fromutc()`. As currently implemented, the algorithm is simply wrong when `dst()` is affected by `fold`, and this change would have no effect on zones where `dst()` is *not* affected by fold.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28602>
_______________________________________


More information about the Python-bugs-list mailing list