IRC logs of #tryton for Monday, 2022-10-03

irc.libera.chat #tryton log beginning Mon Oct 3 12:00:01 AM CEST 2022
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton06:09
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton06:42
-!- ChanServ changed mode/#tryton -> +o cedk 06:42
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton07:10
-!- acaubet(~Thunderbi@194.224.31.235) has joined #tryton07:12
-!- pokoli(~pokoli@user/pokoli) has joined #tryton07:28
-!- ChanServ changed mode/#tryton -> +v pokoli 07:28
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton07:38
cedknicoe: the requirement is not working: https://drone.tryton.org/tryton/trytond/125208:00
nicoecedk: I know: https://bugs.tryton.org/issue1175708:01
cedknicoe: no it is not that08:01
cedknicoe: I think there is a bug in zoneinfo module09:35
cedk>>> dt.datetime(2022, 3, 13, 2, 30, tzinfo=ZoneInfo('Canada/Eastern')).astimezone(ZoneInfo('UTC'))09:36
cedkdatetime.datetime(2022, 3, 13, 7, 30, tzinfo=ZoneInfo(key='UTC'))09:36
cedkbut also:09:36
cedk>>> dt.datetime(2022, 3, 13, 3, 30, tzinfo=ZoneInfo('Canada/Eastern')).astimezone(ZoneInfo('UTC'))09:36
cedkdatetime.datetime(2022, 3, 13, 7, 30, tzinfo=ZoneInfo(key='UTC'))09:36
nicoeThose are both the same point in time09:39
nicoeNo, I didn't see the minutes09:40
nicoe2:30 does not exist09:40
cedknicoe: 2:30 exists but it is already after the DST ends09:41
nicoeIndded it's the other way around09:42
cedkzoneinfo compute the wrong offset09:42
cedk>>> ZoneInfo('Canada/Eastern').utcoffset(dt.datetime(2022, 3, 13, 2, 30))09:42
cedkdatetime.timedelta(days=-1, seconds=68400)09:42
cedk>>> gettz('Canada/Eastern').utcoffset(dt.datetime(2022, 3, 13, 2, 30))09:42
cedkdatetime.timedelta(days=-1, seconds=72000)09:42
cedkindeed setting fold=1 works but at this time there is no ambiguity09:46
nicoeI 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
nicoeHere's what pytz does:09:53
nicoe>>> datetime.datetime(2022, 3, 13, 3, 0, tzinfo=tz).astimezone(utc)09:53
nicoedatetime.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
nicoedatetime.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
nicoedatetime.datetime(2022, 3, 13, 6, 0, tzinfo=tzfile('/usr/share/zoneinfo/UTC'))09:53
cedknicoe: no it is Python that is wrong.09:54
cedknicoe: we never set 2:30 in summer time but 2:30 in Canada so this time can only exist after the DST09:55
cedkbut Python is using the fold value for this case which it should not because it is not ambigous09:55
cedkpytz has a specific test _resolve_ambiguous_time to use or the fold09:56
cedkand pytz is right for 2:00 because this one is ambigus so it is using fold which is 0 by defaut09:58
nicoe2:00 is ambigous because you don't know if it's 2:00 or 3:00 but it shouldn't be equivalent to 1:0009:59
cedknicoe: it is because 1:00 is also ambigous: https://www.timeanddate.com/time/change/canada10:00
nicoeI don't see where you see that it's ambigous10:00
nicoeIt's the case in winter not in summer10:01
cedkoops10:01
cedkindeed it is pytz is_ambiguous that is wrong10:04
cedkindeed it is dateutil is_ambiguous that is wrong10:04
cedkI filled https://bugs.tryton.org/issue1175810:14
-!- nicoe(~nicoe@2a02:578:852a:c00:18c2:1aff:fef9:2b7f) has joined #tryton11:41
-!- tbruyere(~Thunderbi@mail.saluc.com) has joined #tryton14:39
-!- tbruyere(~Thunderbi@82.187-182-91.adsl-dyn.isp.belgacom.be) has joined #tryton17:58
-!- cedk(~ced@gentoo/developer/cedk) has joined #tryton21: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/!