Bug#948891: licensecheck --encoding utf8 exits on error when parsing binary files

Dominique Dumont dod at debian.org
Fri Jan 31 18:17:55 GMT 2020


hi 

licensecheck works fine with binary files once the missing "use Try::Tiny;" line is added on lib/App/Licensecheck.pm. 
Otherwise, the try/catch blocks have no effects (this is one instance where Perl lax syntax is ... not helpful :-( )

With Try::Tiny:

$ perl -wMDevel::SimpleTrace -I ~/private/perlDev/licensecheck/lib/ ~/private/perlDev/licensecheck/bin/licensecheck --encoding utf8 --copyright --machine --deb-fmt --recursive  docs/src/static/diagrams.key/Metadata/Properties.plist
docs/src/static/diagrams.key/Metadata/Properties.plist  UNKNOWN *No copyright*

Without, I got:
$ perl -wMDevel::SimpleTrace -I ~/private/perlDev/licensecheck/lib/ ~/private/perlDev/licensecheck/bin/licensecheck --encoding utf8 --copyright --machine --deb-fmt --recursive  docs/src/static/diagrams.key/Metadata/Properties.plist
utf8 "\xD7" does not map to Unicode
        at IO::Handle::getline(/home/domi/private/perlDev/licensecheck/lib/App/Licensecheck.pm:375)
        at App::Licensecheck::parse_lines(/home/domi/private/perlDev/licensecheck/lib/App/Licensecheck.pm:375)
        at App::Licensecheck::parse(/home/domi/private/perlDev/licensecheck/lib/App/Licensecheck.pm:289)
        at main::(/home/domi/private/perlDev/licensecheck/bin/licensecheck:148)

All the best



More information about the pkg-perl-maintainers mailing list