[bug #68079] Webread fails with simple call

"Dmitri A. Sergatskov" <[email protected]>
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

Follow-up Comment #1, bug #68079 (group octave):

I think the easeast fix is change "disp" --> "display" in weboptions.m file:

--- a/scripts/web/weboptions.m  Mon Feb 16 11:31:33 2026 +0100
+++ b/scripts/web/weboptions.m  Sat Feb 21 06:41:57 2026 -0500
@@ -268,7 +268,7 @@
     endfunction
 
     function f = set.ContentReader (f, value)
-      if (! is_function_handle (value))
+      if ((! isempty (value)) && (! is_function_handle (value)))
         error ("weboptions: ContentReader must be a function handle");
       endif
         ## FIXME: Should emit a warning about unimplemented feature
@@ -305,13 +305,13 @@
       f.CertificateFilename = value;
     endfunction
 
-    function disp (f)
+    function display (f)
 
       Timeout = num2str (f.Timeout);
       Password = repmat ("*", 1, numel (num2str (f.Password)));
 
       if (! isempty (f.ContentReader))
-        ContentReader = disp (f.ContentReader);
+        ContentReader = func2str (f.ContentReader);
       else
         ContentReader = "[]";
       endif
@@ -343,7 +343,7 @@
                 "\n            ArrayFormat: '", f.ArrayFormat, "'",...
                 "\n           HeaderFields: " , HeaderFields,...
                 "\n    CertificateFilename: '", f.CertificateFilename "'"];
-      disp (output);
+      display (output);
 
     endfunction


That should fix this error.

But as a longer term I would probably add a guard to `urlwrite:

--- a/libinterp/corefcn/urlwrite.cc     Mon Feb 16 11:31:33 2026 +0100
+++ b/libinterp/corefcn/urlwrite.cc     Sat Feb 21 06:26:41 2026 -0500
@@ -490,7 +490,14 @@
       if (keys(i) != "Timeout" && keys(i) != "HeaderFields"
           && keys(i) != "delete" && keys(i) != "display")
         {
-          std::string value = object.get (keys(i)).string_value ();
+          octave_value prop_val = object.get (keys(i));
+          if (! prop_val.is_string ())
+            {
+              warning ("__restful_service__: property '%s' is not a string,
skipping",
+                       keys(i).c_str ());
+              continue;
+            }
+          std::string value = prop_val.string_value ();
 
           if (keys(i) == "UserAgent")
             options.UserAgent = value;


CSET with those changes is attached.
(file bug68079_webread_100.cset)

Dmitri.
-- 


(file #58273)

    _______________________________________________________

Additional Item Attachment:

Name: bug68079_webread_100.cset      Size: 3.1KiB

<https://file.savannah.gnu.org/file/bug68079_webread_100.cset?file_id=58273>


    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://savannah.gnu.org/source/savane-2a2ecc185bd672dd377a2efbb667431a4b30acc3.tar.gz


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68079>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaZmbzwAKCRCqLAuaBUf3
TkwmAQC3fL18OaIPvqEhKFYoZOCvsfTOj0j0Xgx05ynG1Vm7NwD7B4/06DigUhTG
CkPZtvK940op6FWUN326PpejXC93RwU=
=xmci
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.