Skip Menu |

This queue is for tickets about the File-Slurp CPAN distribution.

Report information
The Basics
Id: 117005
Status: resolved
Priority: 0/
Queue: File-Slurp

People
Owner: cwhitener [...] gmail.com
Requestors: me [...] eboxr.com
Cc: jik [...] kamens.brookline.ma.us
jkeenan [...] cpan.org
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 9999.23
  • 9999.24
  • 9999.25
Fixed in: (no value)



Subject: File::Slurp is using deprecated syswrite/sysread on utf8 handles [perl 5.24]
This is a problem only with perl 5.24 and later, view https://rt.perl.org/Ticket/Display.html?id=125760 Steps to reproduce: Show quoted text
> perl -MFile::Slurp -E 'say $File::Slurp::VERSION'
9999.19 Show quoted text
> perl -MFile::Slurp -E 'my $p = File::Slurp::read_file( $^X, binmode => q{:utf8} ); File::Slurp::write_file( q{/tmp/xx}, { binmode => q{:utf8}, buf_ref => $p } )'
sysread() is deprecated on :utf8 handles at .../File/Slurp.pm line 225. sysread() is deprecated on :utf8 handles at .../File/Slurp.pm line 225. syswrite() is deprecated on :utf8 handles at .../File/Slurp.pm line 506.
On Tue Aug 16 15:25:48 2016, atoomic wrote: Show quoted text
> This is a problem only with perl 5.24 and later, view > https://rt.perl.org/Ticket/Display.html?id=125760 > > Steps to reproduce: >
> > perl -MFile::Slurp -E 'say $File::Slurp::VERSION'
> 9999.19 >
> > perl -MFile::Slurp -E 'my $p = File::Slurp::read_file( $^X, binmode > > => q{:utf8} ); File::Slurp::write_file( q{/tmp/xx}, { binmode => > > q{:utf8}, buf_ref => $p } )'
> sysread() is deprecated on :utf8 handles at .../File/Slurp.pm line > 225. > sysread() is deprecated on :utf8 handles at .../File/Slurp.pm line > 225. > syswrite() is deprecated on :utf8 handles at .../File/Slurp.pm line > 506.
This is ultimately a result of fixing the bug underlying #83126 in core. Fixing this may require rewriting quite a bit of File::Slurp. Leon
Subject: Re: [rt.cpan.org #117005] File::Slurp is using deprecated syswrite/sysread on utf8 handles [perl 5.24]
Date: Mon, 10 Apr 2017 19:23:22 -0400
To: bug-File-Slurp [...] rt.cpan.org
From: Uri Guttman <uri [...] stemsystems.com>
On 04/10/2017 06:58 PM, Leon Timmermans via RT wrote: Show quoted text
> Queue: File-Slurp > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=117005 > > > On Tue Aug 16 15:25:48 2016, atoomic wrote:
>> This is a problem only with perl 5.24 and later, view >> https://rt.perl.org/Ticket/Display.html?id=125760 >> >> Steps to reproduce: >>
>>> perl -MFile::Slurp -E 'say $File::Slurp::VERSION'
>> 9999.19 >>
>>> perl -MFile::Slurp -E 'my $p = File::Slurp::read_file( $^X, binmode >>> => q{:utf8} ); File::Slurp::write_file( q{/tmp/xx}, { binmode => >>> q{:utf8}, buf_ref => $p } )'
>> sysread() is deprecated on :utf8 handles at .../File/Slurp.pm line >> 225. >> sysread() is deprecated on :utf8 handles at .../File/Slurp.pm line >> 225. >> syswrite() is deprecated on :utf8 handles at .../File/Slurp.pm line >> 506.
> This is ultimately a result of fixing the bug underlying #83126 in core. Fixing this may require rewriting quite a bit of File::Slurp. >
would reading in raw mode first and then converting to utf (with encode) work? i have to get back to hacking my modules so this is a good incentive thanx uri
From: ppisar [...] redhat.com
Dne Po 10.dub.2017 19:33:35, uri@stemsystems.com napsal(a): Show quoted text
> would reading in raw mode first and then converting to utf (with > encode) > work? >
It would fix the warning. But the problem is binmode value has some internal syntax. It's not a plain encoding name. E.g. ":encoding(UTF-8)" is different form ":utf8". Or even ":crlf". (See PerlIO POD.) Should File::Slurp understand the syntax? Fully? Or support only some of them and fail/warn on other ones? Or remove the binmode argument completely and always return byte-string? Or should File::Slurp replace sysread() with high-level PerlIO-aware read()? If yes, then what would happen with support for slurping TTYs and all the other fancy stuff that current code attempts to support?
Now a fatality. Since this commit in bleadperl: https://perl5.git.perl.org/perl.git/commitdiff/1ed4b7762a the test suite fails. Sample fail report: http://www.cpantesters.org/cpan/report/0f2fb0a2-d112-11e8-b0df-bac9a1dbd8f1 XRefs to others who are affected: https://rt.perl.org/Public/Bug/Display.html?id=133585 Maybe raise severity?
No argument on the request to raise the severity or about the fact that this needs to be fixed ASAP. We've been working through some background issues first to get to the point where we felt comfortable in attempting to fix this. Several others are chipping in with help to make it happen. If you have any suggestions, they'd be welcome. #toolchain seems to be where most of the discussions are taking place lately. Thanks, Chase On Tue Oct 16 21:02:54 2018, ANDK wrote: Show quoted text
> Now a fatality. Since this commit in bleadperl: > > https://perl5.git.perl.org/perl.git/commitdiff/1ed4b7762a > > the test suite fails. Sample fail report: > > http://www.cpantesters.org/cpan/report/0f2fb0a2-d112-11e8-b0df- > bac9a1dbd8f1 > > XRefs to others who are affected: > https://rt.perl.org/Public/Bug/Display.html?id=133585 > > Maybe raise severity?
Release 9999.25 was just cut that fixes half of the problem. read_file no longer uses sysopen or sysread. An immense amount of effort was put into this release by many people to ensure everything got tested and we didn't break userland. We smoke tested all 646 reverse dependencies on CPAN to look for regressions. We found and fixed all of the regressions and added regression tests into the test suite. We will start working on the syswrite problem now. The same huge amount of effort will go into testing that change. Thanks to everyone that helped test and fix the regressions! That being said, if you find further regressions, please let us know so we can address them.
Hi Everyone, Version 9999.26 was just released and no longer uses sysread/syswrite. This should be good now for all versions of Perl 5. Thanks, Chase