fgallery broken which might be caused by bug in libjson-xs-perl

gregor herrmann gregoa at debian.org
Sun Jun 24 15:38:04 BST 2018


On Sun, 24 Jun 2018 13:33:23 +0200, Andreas Tille wrote:

> The failure is in all versions
>   hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this) at ./fgallery line 875.
> but I have no idea how to fix this. :-(
> 
> [1] https://people.debian.org/~tille/debug_libjson-xs-perl/debug_libjson-xs-perl.tgz

TBH, I don't see where the error comes from. But using allow_nonref
(which requires switching to the OO interface) seems to work indeed.
No real conclusion but at least a workaround.

#v+
--- fgallery.orig	2018-06-24 16:08:52.393658943 +0200
+++ fgallery	2018-06-24 16:34:51.565712598 +0200
@@ -872,7 +872,8 @@
 unless(open($fd, ">:raw", "$out/data.json")) {
   fatal("cannot write data file: $!");
 }
-print($fd encode_json(\%json));
+my $jsonxs = JSON::XS->new->utf8->pretty->canonical->allow_nonref;
+print($fd $jsonxs->encode(\%json));
 close($fd);
 
 print("completed\n");
#v-

(The other options to JSON::XS can be adjusted to your liking :))

Cheers,
gregor

-- 
 .''`.  https://info.comodo.priv.at -- Debian Developer https://www.debian.org
 : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D  85FA BB3A 6801 8649 AA06
 `. `'  Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe
   `-   NP: Joan Baez: I Shall Be Released
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: Digital Signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-perl-maintainers/attachments/20180624/8ed3b978/attachment.sig>


More information about the pkg-perl-maintainers mailing list