octave-patch-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-patch-tracker] [patch #9980] JSON encoder and decoder, alternati


From: anonymous
Subject: [Octave-patch-tracker] [patch #9980] JSON encoder and decoder, alternative to object2json
Date: Tue, 14 Dec 2021 15:33:17 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0

Follow-up Comment #48, patch #9980 (project octave):

Nice catch.   There is a bug.  

The one you encountered involves leading whitespaces in arrays.  I also found
another bug involving the timestamp string inside an array being confused for
a data structure.   

I fixed both issues, but haven't uploaded yet.  I'm working on developing some
BIST tests involving these cases.  Please give me couple of days get some BIST
in place.

The former is definitely bug and needs to be (has been) addressed before
release of io.

The latter is a quasi-bug.  I did fix fromJSON for this specific case, but I
can't be sure of other cases.  But this kind of problem was anticipated, for
which I had include "SARRAY" (T/F) as an optional input.  Recall that
'toJSON'/'fromJSON' caters to transmitting large, numerical dataset thru JSON,
including curing defect in JSON specification (i.e. JSON spec claims to be
permit IEEE754 numbers, but doesn't actually include provisions for NaN, -Inf
or Inf...UGH!!!!!), while 'jsonencode'/'jsondecode' does not (a grave
oversight by Matlab and Octave teams, IMHO).

While it's correct to expect JSON string like those found in Seamonkey profile
dir to be properly parsed, it is not the main use-case for 'fromJSON' (or
Octave for that matter).   As such, 'fromJSON' defaults to parsing JSON as
numerical arrays.  It is incumbent on the user to set "SARRAY" to FALSE for
safer, slower parsing where confusing complex syntax (like that in Seamonkey
profile JSON) might cause error.   I have amended the help doc to better
emphasis this point.  I might update warning too.  I know you are unfamiliar
with JSON usage, but when I upload, I hope you take a look at the wording and
provide feedback on this.

K

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/patch/?9980>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]