irc.libera.chat #tryton log beginning Mon Oct 3 12:00:01 AM CEST 2022 | ||
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton | 06:09 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 06:42 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 06:42 | |
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton | 07:10 | |
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton | 07:12 | |
-!- pokoli(~pokoli@user/pokoli) has joined #tryton | 07:28 | |
-!- ChanServ changed mode/#tryton -> +v pokoli | 07:28 | |
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton | 07:38 | |
cedk | nicoe: the requirement is not working: https://drone.tryton.org/tryton/trytond/1252 | 08:00 |
---|---|---|
nicoe | cedk: I know: https://bugs.tryton.org/issue11757 | 08:01 |
cedk | nicoe: no it is not that | 08:01 |
cedk | nicoe: I think there is a bug in zoneinfo module | 09:35 |
cedk | >>> dt.datetime(2022, 3, 13, 2, 30, tzinfo=ZoneInfo('Canada/Eastern')).astimezone(ZoneInfo('UTC')) | 09:36 |
cedk | datetime.datetime(2022, 3, 13, 7, 30, tzinfo=ZoneInfo(key='UTC')) | 09:36 |
cedk | but also: | 09:36 |
cedk | >>> dt.datetime(2022, 3, 13, 3, 30, tzinfo=ZoneInfo('Canada/Eastern')).astimezone(ZoneInfo('UTC')) | 09:36 |
cedk | datetime.datetime(2022, 3, 13, 7, 30, tzinfo=ZoneInfo(key='UTC')) | 09:36 |
nicoe | Those are both the same point in time | 09:39 |
nicoe | No, I didn't see the minutes | 09:40 |
nicoe | 2:30 does not exist | 09:40 |
cedk | nicoe: 2:30 exists but it is already after the DST ends | 09:41 |
nicoe | Indded it's the other way around | 09:42 |
cedk | zoneinfo compute the wrong offset | 09:42 |
cedk | >>> ZoneInfo('Canada/Eastern').utcoffset(dt.datetime(2022, 3, 13, 2, 30)) | 09:42 |
cedk | datetime.timedelta(days=-1, seconds=68400) | 09:42 |
cedk | >>> gettz('Canada/Eastern').utcoffset(dt.datetime(2022, 3, 13, 2, 30)) | 09:42 |
cedk | datetime.timedelta(days=-1, seconds=72000) | 09:42 |
cedk | indeed setting fold=1 works but at this time there is no ambiguity | 09:46 |
nicoe | I think the error is in pytz. 2:30 does not exist, in the summer time we go from 2:00 to 3:00. And the other way around in the winter. | 09:53 |
nicoe | Here's what pytz does: | 09:53 |
nicoe | >>> datetime.datetime(2022, 3, 13, 3, 0, tzinfo=tz).astimezone(utc) | 09:53 |
nicoe | datetime.datetime(2022, 3, 13, 7, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC')) | 09:53 |
nicoe | >>> datetime.datetime(2022, 3, 13, 2, 0, tzinfo=tz).astimezone(utc) | 09:53 |
nicoe | datetime.datetime(2022, 3, 13, 6, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC')) | 09:53 |
nicoe | >>> datetime.datetime(2022, 3, 13, 1, 0, tzinfo=tz).astimezone(utc) | 09:53 |
nicoe | datetime.datetime(2022, 3, 13, 6, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC')) | 09:53 |
cedk | nicoe: no it is Python that is wrong. | 09:54 |
cedk | nicoe: we never set 2:30 in summer time but 2:30 in Canada so this time can only exist after the DST | 09:55 |
cedk | but Python is using the fold value for this case which it should not because it is not ambigous | 09:55 |
cedk | pytz has a specific test _resolve_ambiguous_time to use or the fold | 09:56 |
cedk | and pytz is right for 2:00 because this one is ambigus so it is using fold which is 0 by defaut | 09:58 |
nicoe | 2:00 is ambigous because you don't know if it's 2:00 or 3:00 but it shouldn't be equivalent to 1:00 | 09:59 |
cedk | nicoe: it is because 1:00 is also ambigous: https://www.timeanddate.com/time/change/canada | 10:00 |
nicoe | I don't see where you see that it's ambigous | 10:00 |
nicoe | It's the case in winter not in summer | 10:01 |
cedk | oops | 10:01 |
cedk | indeed it is pytz is_ambiguous that is wrong | 10:04 |
cedk | indeed it is dateutil is_ambiguous that is wrong | 10:04 |
cedk | I filled https://bugs.tryton.org/issue11758 | 10:14 |
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton | 11:41 | |
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton | 14:39 | |
-!- tbruyere(~Thunderbi@82.187-182-91.adsl-dyn.isp.belgacom.be) has joined #tryton | 17:58 | |
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton | 21:16 | |
-!- ChanServ changed mode/#tryton -> +o cedk | 21:16 |
Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!