From unknown Fri Jun 20 18:17:38 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#34242 <34242@debbugs.gnu.org> To: bug#34242 <34242@debbugs.gnu.org> Subject: Status: 26.1; json-encode crudely rejects unwelcome objects Reply-To: bug#34242 <34242@debbugs.gnu.org> Date: Sat, 21 Jun 2025 01:17:38 +0000 retitle 34242 26.1; json-encode crudely rejects unwelcome objects reassign 34242 emacs submitter 34242 phs@lsv.fr severity 34242 normal tag 34242 fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 29 09:02:03 2019 Received: (at submit) by debbugs.gnu.org; 29 Jan 2019 14:02:03 +0000 Received: from localhost ([127.0.0.1]:49802 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1goTxj-0007UP-AD for submit@debbugs.gnu.org; Tue, 29 Jan 2019 09:02:03 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1goTxh-0007Ts-H4 for submit@debbugs.gnu.org; Tue, 29 Jan 2019 09:02:01 -0500 Received: from lists.gnu.org ([209.51.188.17]:54574) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1goTxc-0007M0-A0 for submit@debbugs.gnu.org; Tue, 29 Jan 2019 09:01:56 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goTxb-0002qs-F4 for bug-gnu-emacs@gnu.org; Tue, 29 Jan 2019 09:01:56 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1goTxT-0007Iq-UZ for bug-gnu-emacs@gnu.org; Tue, 29 Jan 2019 09:01:55 -0500 Received: from olive.lsv.fr ([138.231.81.248]:49924 helo=olive.lsv.ens-cachan.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1goTxL-0007FQ-P1 for bug-gnu-emacs@gnu.org; Tue, 29 Jan 2019 09:01:41 -0500 Received: from phs-r2.local (unknown [182.156.209.254]) by olive.lsv.ens-cachan.fr (Postfix) with ESMTP id 834214C01CB for ; Tue, 29 Jan 2019 15:01:32 +0100 (CET) To: bug-gnu-emacs@gnu.org From: phs Subject: 26.1; json-encode crudely rejects unwelcome objects Openpgp: preference=signencrypt Autocrypt: addr=phs@lsv.fr; prefer-encrypt=mutual; keydata= mQINBFhTzXQBEACq1ek8JCJGXlc+7gCenCmnxz2m/51Dur4O0mUHqxn4Ca+iB0VcGoioqLRJ 7064IPpZKrfFJkWo19xu+nobRqFubAY+BVGnzB4akYgAbyEPCLM6Q4YfBhW3o30/IoRRAI1W 72DenjV5frjnqerlJ146t/RLsoGaeDUeClH0NpPI/61smPxKW7AEvLVvVvckrSt7PAoEHCGb ohPBe2LSknbDp8jApY+eQBtYRXOpakjyg6D1md2LEuDUgKBLf1UWZ82CYb5gl3kiPZXOGYtV BPB9rCMGWe5bllTx0OJzn2DWeI2lHQv+9Ys1j5Df9jY+nzFvUiRQOtjMCKrT6Bf9YE5aRs8b gmjImqaxj5wDYRFtQ4OgmQqSstcOiHZZh3ATsxEfbEBACwHyUpPK5+PrzRRcLOvGq5Ahyxmn lCfvTgvNfhn5oIwloeicXY7Zn7nWqajDDHaeCQ7Xt8tU3Qd0Z+NuMm7/ghhInXszuwRsHYQm J2YETh03PREIrJ2LUdYX8AdrZ04mLc3+ZY7ReS6K0LvNdA/ql50jLziq3QBCMZkqdQFQkQ4S 9nSakrdqyqS7iMH8RAeLlrxnYLwJ9am1RFDJ+nnia90xJATQcM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9Nl5BY8OGcy498evPUeZJSCzNYyLnnClsU25Xr6TCqJezIVitl/ gnZQQ7XvIe6QyoAZHqa1NtGdKZDMFjio+3NCSblaE61kH+5amUbLRSv4VLcY7bjcr6SkYDjy F5OZXSezpJgbhk5NAaFy8+1yUPOGES13pFWcNjNBCOyB1gH2dW4BSwUaWx+dg9c= Organization: CNRS & ENS Paris Saclay Message-ID: <75a45070-5d27-3a7d-da1a-84b539986d7b@lsv.fr> Date: Tue, 29 Jan 2019 19:31:28 +0530 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 138.231.81.248 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: phs@lsv.fr Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) json-encode is supposed to return a JSON representation of its argument. It fails on some objects: (setq debug-on-error t) (require 'json) (json-encode (list (list 1))) ==> Debugger entered--Lisp error: (json-key-format 1) (json-encode (list (cons (cons 'a 'b) 'a))) ==> Debugger entered--Lisp error: (wrong-type-argument listp a) I understand that maybe not all objects make sense for json-encoding but the documentation of json-encode does not specify what is a valid argument, and (it seems) the package does not do it either. Also the documentation does not list the error-codes so that we could catch them in code. --phs From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 09 13:42:28 2019 Received: (at 34242) by debbugs.gnu.org; 9 Jul 2019 17:42:28 +0000 Received: from localhost ([127.0.0.1]:34116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hku8J-0001pC-19 for submit@debbugs.gnu.org; Tue, 09 Jul 2019 13:42:27 -0400 Received: from quimby.gnus.org ([80.91.231.51]:50474) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hku8G-0001p0-Gh for 34242@debbugs.gnu.org; Tue, 09 Jul 2019 13:42:25 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hku8B-0007o5-Km; Tue, 09 Jul 2019 19:42:22 +0200 From: Lars Ingebrigtsen To: phs Subject: Re: bug#34242: 26.1; json-encode crudely rejects unwelcome objects References: <75a45070-5d27-3a7d-da1a-84b539986d7b@lsv.fr> Date: Tue, 09 Jul 2019 19:42:19 +0200 In-Reply-To: <75a45070-5d27-3a7d-da1a-84b539986d7b@lsv.fr> (phs@lsv.fr's message of "Tue, 29 Jan 2019 19:31:28 +0530") Message-ID: <87wogrqf44.fsf@mouse.gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: phs writes: > json-encode is supposed to return a JSON representation of its argument. > > It fails on some objects: > > (setq debug-on-error t) > (require 'json) > > (json-encode (list (list 1))) > > ==> Debugge [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34242 Cc: 34242@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) phs writes: > json-encode is supposed to return a JSON representation of its argument. > > It fails on some objects: > > (setq debug-on-error t) > (require 'json) > > (json-encode (list (list 1))) > > ==> Debugger entered--Lisp error: (json-key-format 1) > > (json-encode (list (cons (cons 'a 'b) 'a))) > > ==> Debugger entered--Lisp error: (wrong-type-argument listp a) > > I understand that maybe not all objects make sense for json-encoding but > the documentation of json-encode does not specify what is a valid > argument, and (it seems) the package does not do it either. > > Also the documentation does not list the error-codes so that we could > catch them in code. I've now added some text to this function (and json-read) about what the inputs, return values are and what error signals are raised to the Emacs trunk. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 09 13:42:29 2019 Received: (at control) by debbugs.gnu.org; 9 Jul 2019 17:42:29 +0000 Received: from localhost ([127.0.0.1]:34119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hku8L-0001pT-Gi for submit@debbugs.gnu.org; Tue, 09 Jul 2019 13:42:29 -0400 Received: from quimby.gnus.org ([80.91.231.51]:50488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hku8K-0001pE-3I for control@debbugs.gnu.org; Tue, 09 Jul 2019 13:42:28 -0400 Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hku8H-0007oC-HZ for control@debbugs.gnu.org; Tue, 09 Jul 2019 19:42:27 +0200 Date: Tue, 09 Jul 2019 19:42:25 +0200 Message-Id: <87v9wbqf3y.fsf@mouse.gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #34242 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 34242 fixed close 34242 27.1 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 34242 fixed close 34242 27.1 quit From unknown Fri Jun 20 18:17:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 07 Aug 2019 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator