GNU bug report logs -
#39347
28.0.50; iso8601-parse can't handle all legal date values?
Previous Next
Reported by: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Date: Wed, 29 Jan 2020 21:01:02 UTC
Severity: normal
Found in version 28.0.50
Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39347 in the body.
You can then email your comments to 39347 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39347
; Package
emacs
.
(Wed, 29 Jan 2020 21:01:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Eric Abrahamsen <eric <at> ericabrahamsen.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 29 Jan 2020 21:01:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi!
I'm writing a small library for parsing vcards, and would like to use
the new iso8601 library, when available, for parsing date properties.
I'm testing out `iso9601-parse' with the example values from the vcard
RFC, and am getting errors from the example date value "---12", from
https://tools.ietf.org/html/rfc6350#section-4.3.1.
My understanding is that "---12" as a date should parse to:
(nil nil nil 12 nil nil nil -1 nil)
Ie, "the twelfth" (though the twelfth of what, we don't know). "----12"
also raises an error. The value "--0412" parses correctly to "April
twelfth".
Is this a bug that can be fixed, or a date value that isn't supported?
Thanks,
Eric
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39347
; Package
emacs
.
(Wed, 29 Jan 2020 22:51:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 39347 <at> debbugs.gnu.org (full text, mbox):
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
> I'm testing out `iso9601-parse' with the example values from the vcard
> RFC, and am getting errors from the example date value "---12", from
> https://tools.ietf.org/html/rfc6350#section-4.3.1.
>
> My understanding is that "---12" as a date should parse to:
>
> (nil nil nil 12 nil nil nil -1 nil)
I'm unable to find that form in
http://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_iso_wd_8601-1_2016-02-16.pdf
The RFC talks about the ISO8601 standard from 2000 -- perhaps those
forms have been deprecated?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39347
; Package
emacs
.
(Wed, 29 Jan 2020 23:24:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 39347 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> I'm testing out `iso9601-parse' with the example values from the vcard
>> RFC, and am getting errors from the example date value "---12", from
>> https://tools.ietf.org/html/rfc6350#section-4.3.1.
>>
>> My understanding is that "---12" as a date should parse to:
>>
>> (nil nil nil 12 nil nil nil -1 nil)
>
> I'm unable to find that form in
>
> http://www.loc.gov/standards/datetime/iso-tc154-wg5_n0038_iso_wd_8601-1_2016-02-16.pdf
>
> The RFC talks about the ISO8601 standard from 2000 -- perhaps those
> forms have been deprecated?
I sure hope so! Anyway, looks like the library is correct, and I just
get to decide if I want to support deprecated forms that might be sent
by someone's random outdated carddav server. Bleagh.
I want this package to support older Emacs than 27 -- I wonder if anyone
would yell at me if stuck a copy of iso8601.el in the package, and only
load it if the built-in one can't be found.
Eric
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39347
; Package
emacs
.
(Wed, 29 Jan 2020 23:29:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 39347 <at> debbugs.gnu.org (full text, mbox):
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
> I sure hope so! Anyway, looks like the library is correct, and I just
> get to decide if I want to support deprecated forms that might be sent
> by someone's random outdated carddav server. Bleagh.
I think we could extend the library to handle those forms -- if they
aren't ambiguous. (I seem to vaguely remember that there were some
forms that were ambiguous when shortened, but I don't remember the
details.)
Do you have a pointer to the 2000 version of the ISO8601 standard? I
could have a peek.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39347
; Package
emacs
.
(Thu, 30 Jan 2020 00:39:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 39347 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>> I sure hope so! Anyway, looks like the library is correct, and I just
>> get to decide if I want to support deprecated forms that might be sent
>> by someone's random outdated carddav server. Bleagh.
>
> I think we could extend the library to handle those forms -- if they
> aren't ambiguous. (I seem to vaguely remember that there were some
> forms that were ambiguous when shortened, but I don't remember the
> details.)
>
> Do you have a pointer to the 2000 version of the ISO8601 standard? I
> could have a peek.
These are surprisingly hard to find:
https://www.pvv.ntnu.no/~nsaa/8601v2000.pdf
Section 5.2.1.3 does the truncation stuff, including the three hyphens.
Looking up information about 8601, the only references to this
"truncated representation" are from the vCard spec. That is stupid, but
also leads me to believe that they're still considered legal for vCards,
so it would be nice if they were supported. Maybe with defvar we could
let-bind, to say "allow these variants"? Some of the
potentially ambiguous stuff does seem to rely on agreement between
producer and consumer.
vCard also mentions "reduced accuracy" and "expanded representation",
from the 2004 version of 8601 -- is that something that the library
currently handles? I assume it does since I haven't been able to raise
any other errors.
Thanks for looking in to this,
Eric
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39347
; Package
emacs
.
(Thu, 30 Jan 2020 01:04:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 39347 <at> debbugs.gnu.org (full text, mbox):
Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>> Do you have a pointer to the 2000 version of the ISO8601 standard? I
>> could have a peek.
>
> These are surprisingly hard to find:
> https://www.pvv.ntnu.no/~nsaa/8601v2000.pdf
Yeah, many ISO standards cost money, so you can only find them if
somebody has happened to have left a copy somewhere on the web "by
accident". :-/
> Section 5.2.1.3 does the truncation stuff, including the three hyphens.
>
> Looking up information about 8601, the only references to this
> "truncated representation" are from the vCard spec. That is stupid, but
> also leads me to believe that they're still considered legal for vCards,
> so it would be nice if they were supported. Maybe with defvar we could
> let-bind, to say "allow these variants"? Some of the
> potentially ambiguous stuff does seem to rely on agreement between
> producer and consumer.
Nah. Looking at 5.2.1.3 in the 2000 version of the standard, it looks
like what we're missing is just the e) and f) forms, and it looks like
they're not ambiguous, so I think I'll just go ahead and add them to the
iso8601 library.
I'm not sure about the a-c) variants -- the ones with implied
century... are they ambiguous? Hm... perhaps not...
> vCard also mentions "reduced accuracy" and "expanded representation",
> from the 2004 version of 8601 -- is that something that the library
> currently handles? I assume it does since I haven't been able to raise
> any other errors.
The library doesn't handle "expanded representation", but it should
handle all the "reduced accuracy" forms. At least in the 2016 version
of the standard.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39347
; Package
emacs
.
(Thu, 30 Jan 2020 01:12:01 GMT)
Full text and
rfc822 format available.
Message #23 received at 39347 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Nah. Looking at 5.2.1.3 in the 2000 version of the standard, it looks
> like what we're missing is just the e) and f) forms, and it looks like
> they're not ambiguous, so I think I'll just go ahead and add them to the
> iso8601 library.
I've now done so on the trunk.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39347
; Package
emacs
.
(Thu, 30 Jan 2020 01:15:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 39347 <at> debbugs.gnu.org (full text, mbox):
On 01/30/20 02:03 AM, Lars Ingebrigtsen wrote:
> Eric Abrahamsen <eric <at> ericabrahamsen.net> writes:
>
>>> Do you have a pointer to the 2000 version of the ISO8601 standard? I
>>> could have a peek.
>>
>> These are surprisingly hard to find:
>> https://www.pvv.ntnu.no/~nsaa/8601v2000.pdf
>
> Yeah, many ISO standards cost money, so you can only find them if
> somebody has happened to have left a copy somewhere on the web "by
> accident". :-/
>
>> Section 5.2.1.3 does the truncation stuff, including the three hyphens.
>>
>> Looking up information about 8601, the only references to this
>> "truncated representation" are from the vCard spec. That is stupid, but
>> also leads me to believe that they're still considered legal for vCards,
>> so it would be nice if they were supported. Maybe with defvar we could
>> let-bind, to say "allow these variants"? Some of the
>> potentially ambiguous stuff does seem to rely on agreement between
>> producer and consumer.
>
> Nah. Looking at 5.2.1.3 in the 2000 version of the standard, it looks
> like what we're missing is just the e) and f) forms, and it looks like
> they're not ambiguous, so I think I'll just go ahead and add them to the
> iso8601 library.
Cool!
> I'm not sure about the a-c) variants -- the ones with implied
> century... are they ambiguous? Hm... perhaps not...
I'm not worried about it for this case, at least, as vCard disallows a
through c.
>> vCard also mentions "reduced accuracy" and "expanded representation",
>> from the 2004 version of 8601 -- is that something that the library
>> currently handles? I assume it does since I haven't been able to raise
>> any other errors.
>
> The library doesn't handle "expanded representation", but it should
> handle all the "reduced accuracy" forms. At least in the 2016 version
> of the standard.
Good enough for me. I will steal the library once you've made these
updates.
Thanks again,
Eric
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39347
; Package
emacs
.
(Thu, 30 Jan 2020 01:16:01 GMT)
Full text and
rfc822 format available.
Message #29 received at 39347 <at> debbugs.gnu.org (full text, mbox):
Hm... I didn't add support for "---12T14" (that is, 14:00 on the
twelfth)... I didn't peruse the 2000 version of the standard
sufficiently to see whether that was supposed to be valid or not. My
guess is that it was. :-/
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39347
; Package
emacs
.
(Thu, 30 Jan 2020 02:06:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 39347 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Hm... I didn't add support for "---12T14" (that is, 14:00 on the
> twelfth)... I didn't peruse the 2000 version of the standard
> sufficiently to see whether that was supposed to be valid or not. My
> guess is that it was. :-/
OK, I couldn't live with that, so I've now made this work:
(iso8601-parse "---12T14")
=> (0 0 14 12 nil nil nil -1 nil)
This'll be useful for exactly nobody. :-)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#39347
; Package
emacs
.
(Thu, 30 Jan 2020 03:33:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 39347 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> Hm... I didn't add support for "---12T14" (that is, 14:00 on the
>> twelfth)... I didn't peruse the 2000 version of the standard
>> sufficiently to see whether that was supposed to be valid or not. My
>> guess is that it was. :-/
>
> OK, I couldn't live with that, so I've now made this work:
>
> (iso8601-parse "---12T14")
> => (0 0 14 12 nil nil nil -1 nil)
>
> This'll be useful for exactly nobody. :-)
I already count as one!
Closing the bug report now -- thanks.
Reply sent
to
Eric Abrahamsen <eric <at> ericabrahamsen.net>
:
You have taken responsibility.
(Thu, 30 Jan 2020 03:33:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Eric Abrahamsen <eric <at> ericabrahamsen.net>
:
bug acknowledged by developer.
(Thu, 30 Jan 2020 03:33:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 27 Feb 2020 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 114 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.