GNU bug report logs - #48228
json-serialize should signal error when dll is not found [MS Windows]

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Tue, 4 May 2021 15:26:02 UTC

Severity: normal

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 48228 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, p.stephani2 <at> gmail.com, 48228 <at> debbugs.gnu.org
Subject: Re: bug#48228: json-serialize should signal error when dll is not
 found [MS Windows]
Date: Tue, 4 May 2021 19:59:15 +0300
On 04.05.2021 19:43, Robert Pluim wrote:
> What makes it error-prone? Those existing testing functions (on
> Windows) attempt to load the relevant DLL's using the exact same
> mechanisms as the actual code, so the failure (and success) modes are
> identical.

When somebody write code using json-serialize, and it can't do what it 
was asked to do, it should raise an error.

I have code like this in a separate project:

  (cond ((fboundp 'json-parse-buffer)
         (json-parse-buffer
          :array-type 'list
          :object-type 'alist
          :null-object nil))
        (t
         (let ((json-array-type 'list))
           (json-read))))

It has been there for a couple of years. And only now I find out that it 
can fail on MS Windows, because that failure is not reproducible on any 
other platform. I can only hope that whatever random Windows users 
encountered it saw the message wherever it was printed, and it was not 
concealed by subsequent messages from the caller code (reporting some 
cryptic errors, I imagine).

That's not to say we must not have a function json-available-p. If it's 
helpful, why not add it as well.




This bug report was last modified 3 years and 305 days ago.

Previous Next


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