Package: libconfig-model-dpkg-perl Severity: normal Version: 2.101 Tag: patch
YAML::XS::Load (and *hopefully* the other implementations of YAML::Any::Load?) expect utf8 octets on input, not perl's internal encoding. Thus, slurp_raw should be used instead of slurp_utf8. [Though really, YAML::XS::Load should probably do the right thing if is_utf8 is on, anyway.] -- Don Armstrong https://www.donarmstrong.com I will not make any deals with you. I've resigned. I will not be pushed, filed, stamped, indexed, briefed, debriefed or numbered. My life is my own. I resign. -- Patrick McGoohan as Number 6 in "The Prisoner"
From 778867c1a9c9ff80ad2ba272845397c39e4030e7 Mon Sep 17 00:00:00 2001 From: Don Armstrong <d...@debian.org> Date: Mon, 30 Oct 2017 15:24:57 -0700 Subject: [PATCH] use slurp_raw for Load $yaml to get raw UTF8 octets YAML::XS::Load needs utf8 octets on input, not perl's internal encoding. --- lib/Dpkg/Copyright/Scanner.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Dpkg/Copyright/Scanner.pm b/lib/Dpkg/Copyright/Scanner.pm index b6e07be9..8db18d37 100644 --- a/lib/Dpkg/Copyright/Scanner.pm +++ b/lib/Dpkg/Copyright/Scanner.pm @@ -177,7 +177,7 @@ sub scan_files ( %args ) { my $scan_patterns = $debian->child("copyright-scan-patterns.yml"); if ($debian->is_dir and $scan_patterns->is_file) { - my $yaml = $scan_patterns->slurp_utf8; + my $yaml = $scan_patterns->slurp_raw; # { check => { suffixes => [ js pl ], pattern => '[A-Z]*'}, ignore => { suffixes => [ jpg png ], pattern => 'foo.*'} } $scan_data = Load $yaml; } @@ -613,7 +613,7 @@ sub __load_fill_blank_data ($current_dir) { warn "Note: loading @fills fixes" if @fills and not $quiet; foreach my $file ( @fills) { - my $yaml = $file->slurp_utf8; + my $yaml = $file->slurp_raw; my $data = Load $yaml; foreach my $path (sort keys %$data) { if ($fill_blanks{$path}) { -- 2.15.0.rc1