Bug#1025722: duck fails with 'Can't close(GLOB(0x558bebc05958)) filehandle: 'Is a directory' at /usr/share/duck/lib/checks/patch_files.pm line 101'

Niko Tyni ntyni at debian.org
Thu Dec 8 20:10:09 GMT 2022


On Thu, Dec 08, 2022 at 12:45:29AM +0100, gregor herrmann wrote:
> Package: duck
> Version: 0.14.0
> Severity: grave
> Justification: renders package unusable
> X-Debbugs-Cc: perl at packages.debian.org

> As of today, duck (called in any source package directory) fails with
> 
> Can't close(GLOB(0x558bebc05958)) filehandle: 'Is a directory' at /usr/share/duck/lib/checks/patch_files.pm line 101'
> 
>     92	        # iterate over all patchdirs, process all files found
>     93	        foreach my $patchdir (@patchdirs) {
>     94	            my $dirhandle = dir($patchdir)->open;
>     95	
>     96	            while (my $patchfile = $dirhandle->read) {
>     97	                open my $pf, "<", $patchdir . "/" . $patchfile;
>     98	
>     99	                my @pf_raw = <$pf>;
>    100	
>    101	                close($pf);
> 
> This may or may not be caused by a recent change in src:perl [0], hence
> cc'in the perl maintainers

Thanks. It's definitely that change, but I think the bug is in duck.
The above code is treating directories as plain files under autodie,
so bailing out seems warranted. Earlier it just failed silently.

A straightforward fix would be inserting something like

    next if -d $patchdir . "/" . $patchfile;

on line 97 or so (but using File::Spec->catfile() would feel cleaner
to me.)

Baptiste: please let us know if/when duck is fixed so we can add a
suitable Breaks entry on the perl side. (And obviously let us also know
if you disagree about the bug :)

BTW it seems like duck could use an autopkgtest test suite so things
like this would be detected automatically.
-- 
Niko Tyni   ntyni at debian.org



More information about the Perl-maintainers mailing list