Your message dated Fri, 30 Sep 2022 19:57:16 +0200
with message-id <875yh4lp8j....@hands.com>
and subject line no longer reproducible
has caused the Debian Bug report #916681,
regarding Perl::Tidy: tries to access file "SCALAR(0x...)" in cwd
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
916681: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916681
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: perltidy
Version: 20180220-1
Control: affects -1 libperl-critic-perl
The attached test program print its own tidied source.
It seems to work correctly:
$ perl selftidy
#!/usr/bin/perl
use Perl::Tidy qw(perltidy);
my $dst;
perltidy( source => $0, destination => \$dst );
print($dst);
But in strace output you can see a spurious filesystem access:
$ strace -o '| grep -w SCALAR >&2' perl selftidy > /dev/null
stat64("SCALAR(0x56bcb8a8)", 0x56bac2b0) = -1 ENOENT (No such file or
directory)
I tracked it down to this code in Perl/Tidy.pm, lines 1278-1291:
# set output file permissions
if ( $output_file && -f $output_file && !-l $output_file ) {
if ($input_file_permissions) {
# give output script same permissions as input script, but
# make it user-writable or else we can't run perltidy again.
# Thus we retain whatever executable flags were set.
if ( $rOpts->{'format'} eq 'tidy' ) {
chmod( $input_file_permissions | oct(600), $output_file );
}
# else use default permissions for html and any other format
}
}
Apparently this is run even when $output_file is a reference, not a
pathname.
-- System Information:
Architecture: i386
Versions of packages perltidy depends on:
ii perl 5.28.1-3
--
Jakub Wilk
#!/usr/bin/perl
use Perl::Tidy qw(perltidy);
my $dst;
perltidy(source => $0, destination => \$dst);
print($dst);
--- End Message ---
--- Begin Message ---
fixed - 20220613-1
done
Looking at the code (in 20220613-1), it's changed considerably, and the
bug is no longer reproducible.
--- End Message ---