From: Dipl. I. S. G. B. <se...@us...> - 2024-07-16 19:28:20
|
Yep - it was missing % 7 in the validation check (Sunday may be 7 or 0), thx for notice! Strange is that I (or many who used tclclockmod with valid mode) never noticed that. Anyway fixed in: [55c23b44b5] [4] merge 8.7 (clock: fix validation check for scanned Sunday) (tags: trunk [5], main [6]) [8f854a2a24] [7] clock: fix validation check for scanned Sunday (missing % 7 by compare) (tags: core-8-branch [8]) Regards, Serg. 16.07.2024 17:47, Andreas Kupries wrote: > My script is > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > puts [info patchlevel] > foreach {n date} { > 1 {Sat, 01 Jan 2000 23:59:00} > 2 {Tue, 29 Feb 2000 21:57:00} > 3 {Sun, 31 Dec 2000 20:42:00} > 4 {Mon, 01 Jan 2001 23:59:00} > 5 {Thu, 28 Feb 2002 21:57:00} > 6 {Wed, 31 Dec 2003 20:42:00} > } { > puts "$date -- [catch {clock scan $date -gmt 1} clock] = $clock" > } > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > All is ok using 8.6.12 > > For 9.0b3 however it fails __just__ for Sunday. If it failed for all I would > say that the relevant > code has to be updated to the clock changes in Tcl 9. However, for just one > specific weekday ? That > looks more like a bug in the new clock stuff to me. > > Given that the issue is with Sunday I wonder if it is an issue with the > conversion to a numeric > code, i.e. Sunday can be start or end of the week, depending. > > % tclsh z.tcl > > 8.6.12 > Sat, 01 Jan 2000 23:59:00 -- 0 = 946771140 > Tue, 29 Feb 2000 21:57:00 -- 0 = 951861420 > Sun, 31 Dec 2000 20:42:00 -- 0 = 978295320 > Mon, 01 Jan 2001 23:59:00 -- 0 = 978393540 > Thu, 28 Feb 2002 21:57:00 -- 0 = 1014933420 > Wed, 31 Dec 2003 20:42:00 -- 0 = 1072903320 > > % tclsh9 z.tcl > > 9.0b3 > Sat, 01 Jan 2000 23:59:00 -- 0 = 946771140 > Tue, 29 Feb 2000 21:57:00 -- 0 = 951861420 > Sun, 31 Dec 2000 20:42:00 -- 1 = unable to convert input string: invalid day > of week > Mon, 01 Jan 2001 23:59:00 -- 0 = 978393540 > Thu, 28 Feb 2002 21:57:00 -- 0 = 1014933420 > Wed, 31 Dec 2003 20:42:00 -- 0 = 1072903320 > > The original code is from the tcllib `mime.test`, 10.* checking > `mime::parsedatetime`. > > -- > Happy Tcling, > Andreas Kupries <and...@gm...> > <https://core.tcl-lang.org/akupries/ [1]> > <https://akupries.tclers.tk/ [2]> > Developer @ SUSE Software Solutions Germany GmbH > ------------------------------------------------------------------------------- > > _______________________________________________ > Tcl-Core mailing list > Tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-core [3] Links: ------ [1] https://core.tcl-lang.org/akupries/ [2] https://akupries.tclers.tk/ [3] https://lists.sourceforge.net/lists/listinfo/tcl-core [4] http://mail.sebres.de/tcl/info/55c23b44b5cefcef [5] http://mail.sebres.de/tcl/timeline?r=trunk&c=2024-07-16+19%3A18%3A56 [6] http://mail.sebres.de/tcl/timeline?r=main&c=2024-07-16+19%3A18%3A56 [7] http://mail.sebres.de/tcl/info/8f854a2a24046dd2 [8] http://mail.sebres.de/tcl/timeline?r=core-8-branch&c=2024-07-16+19%3A17%3A05 |