GNU bug report logs - #15097
24.3.50; json.el can't encode lists of lists

Previous Next

Package: emacs;

Reported by: Rolando Pereira <rolando_pereira <at> sapo.pt>

Date: Wed, 14 Aug 2013 22:46:02 UTC

Severity: normal

Found in version 24.3.50

Done: Daniel Colascione <dancol <at> dancol.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Daniel Colascione <dancol <at> dancol.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#15097: closed (24.3.50; json.el can't encode lists of lists)
Date: Sun, 23 Mar 2014 06:41:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 22 Mar 2014 23:40:19 -0700
with message-id <532E81D3.3040905 <at> dancol.org>
and subject line Wontfix, apparently
has caused the debbugs.gnu.org bug report #15097,
regarding 24.3.50; json.el can't encode lists of lists
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
15097: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15097
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Rolando Pereira <rolando_pereira <at> sapo.pt>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; json.el can't encode lists of lists
Date: Wed, 14 Aug 2013 23:44:36 +0100
Hello all,

The function `json-encode' can't encode a list thats composed only of other
lists, i.e. the following doesn't work:

    (json-encode '((1 2 3))) => Error: (json-key-format 1)

If I had an extra "nil" in the topmost list `json-encode' then it works
fine:

    (json-encode '((1 2 3) nil)) => "[[1,2,3],null]"

However if I replace the `nil' with another list then I get the same
error:

    (json-encode '((1 2 3) (4))) => Error: (json-key-format 1)

Here's a small ERT test that should trigger the bug:

    (ert-deftest json-encode-list-of-lists-test ()
      (ert-should (string= (json-encode '(1 2 3)) "[1,2,3]"))              ; works
      (ert-should (string= (json-encode '((1) 2 3)) "[[1],2,3]"))          ; works
      (ert-should (string= (json-encode '((1 2 3))) "[[1,2,3]]"))          ; doesn't work
      (ert-should (string= (json-encode '((1 2 3) nil)) "[[1,2,3],null]")) ; works
      (ert-should (string= (json-encode '((1 2 3) (4))) "[[1,2,3],[4]]"))  ; doesn't work
      )


Best regards,
Rolando Pereira


[Message part 3 (message/rfc822, inline)]
From: Daniel Colascione <dancol <at> dancol.org>
To: 15097-done <at> debbugs.gnu.org
Subject: Wontfix, apparently
Date: Sat, 22 Mar 2014 23:40:19 -0700
[Message part 4 (text/plain, inline)]
Wontfix according to discussion

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 11 years and 65 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.