Skip Menu |
Report information
Id: 133610
Status: rejected
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: tonyc <tony [at] develop-help.com>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: unknown
Perl Version: (no value)
Fixed In: (no value)



Date: Tue, 23 Oct 2018 11:13:34 +1100
Subject: [RFC] feature sysio_bytes
From: Tony Cook <tony [...] develop-help.com>
To: perlbug [...] perl.org
Download (untitled) / with headers
text/plain 713b
In [perl #125760] I suggested obsoleting sysread and syswrite on :utf8 handles, and after some discussion on #p5p, also deprecated send and recv on :utf8 handles. With 5c0551aafb45d343b720500fd9560ffedd9607fa the deprecation was carried through and these operators now croak when used on a :utf8 handle. So how can we get to a saner behaviour for these operators without silently changing the behaviour of existing code? The attached patches add a new feature that prevents these operators from croaking when used on a :utf8 handle, but also makes them work in bytes, rather then the sketchy way they did before. This feature is currently not part of any version feature bundles, but this could change. Tony

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1012b
On Tue, 23 Oct 2018 00:13:55 GMT, tonyc wrote: Show quoted text
> In [perl #125760] I suggested obsoleting sysread and syswrite on :utf8 > handles, and after some discussion on #p5p, also deprecated send and > recv on :utf8 handles. > > With 5c0551aafb45d343b720500fd9560ffedd9607fa the deprecation was > carried through and these operators now croak when used on a :utf8 > handle. > > So how can we get to a saner behaviour for these operators without > silently changing the behaviour of existing code? > > The attached patches add a new feature that prevents these operators > from croaking when used on a :utf8 handle, but also makes them work in > bytes, rather then the sketchy way they did before. > > This feature is currently not part of any version feature bundles, but > this could change. > > Tony
To facilitate evaluation of this feature request, I have placed the patches in this branch for smoke testing: smoke-me/jkeenan/tonyc/133610-sysio-bytes Thank you very much. -- James E Keenan (jkeenan@cpan.org)
To: Perl5 Porters <perl5-porters [...] perl.org>
CC: bugs-bitbucket [...] rt.perl.org
From: Leon Timmermans <fawaka [...] gmail.com>
Date: Fri, 26 Oct 2018 23:20:39 +0200
Subject: Re: [perl #133610] [RFC] feature sysio_bytes
Download (untitled) / with headers
text/plain 1.1k
On Tue, Oct 23, 2018 at 2:14 AM Tony Cook (via RT) <perlbug-followup@perl.org> wrote:
Show quoted text
# New Ticket Created by  Tony Cook
# Please include the string:  [perl #133610]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=133610 >


In [perl #125760] I suggested obsoleting sysread and syswrite on :utf8
handles, and after some discussion on #p5p, also deprecated send and
recv on :utf8 handles.

With 5c0551aafb45d343b720500fd9560ffedd9607fa the deprecation was
carried through and these operators now croak when used on a :utf8
handle.

So how can we get to a saner behaviour for these operators without
silently changing the behaviour of existing code?

The attached patches add a new feature that prevents these operators
from croaking when used on a :utf8 handle, but also makes them work in
bytes, rather then the sketchy way they did before.

This feature is currently not part of any version feature bundles, but
this could change.

What is the use-case of this feature?

I'm not really seeing any new possibilities, or even better syntax for old possibilities.

Leon
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.6k
On Fri, 26 Oct 2018 14:20:59 -0700, LeonT wrote: Show quoted text
> On Tue, Oct 23, 2018 at 2:14 AM Tony Cook (via RT) < > perlbug-followup@perl.org> wrote: >
> > # New Ticket Created by Tony Cook > > # Please include the string: [perl #133610] > > # in the subject line of all future correspondence about this issue. > > # <URL: https://rt.perl.org/Ticket/Display.html?id=133610 > > > > > > > In [perl #125760] I suggested obsoleting sysread and syswrite on :utf8 > > handles, and after some discussion on #p5p, also deprecated send and > > recv on :utf8 handles. > > > > With 5c0551aafb45d343b720500fd9560ffedd9607fa the deprecation was > > carried through and these operators now croak when used on a :utf8 > > handle. > > > > So how can we get to a saner behaviour for these operators without > > silently changing the behaviour of existing code? > > > > The attached patches add a new feature that prevents these operators > > from croaking when used on a :utf8 handle, but also makes them work in > > bytes, rather then the sketchy way they did before. > > > > This feature is currently not part of any version feature bundles, but > > this could change. > >
> > What is the use-case of this feature? > > I'm not really seeing any new possibilities, or even better syntax for old > possibilities.
The intent is to make sensible behaviour for these operators available even if the handle has the :utf8 flag. I would have preferred (at the #125760 timeframe) to make these ops just work in file bytes, whatever layers had been pushed, but that would have been a silent change in behaviour and hence Bad(tm). Of course, someone who wants such sane behaviour could just: binmode($foo); Tony
CC: Perl5 Porters <perl5-porters [...] perl.org>
From: Leon Timmermans <fawaka [...] gmail.com>
To: perlbug <perlbug-followup [...] perl.org>
Subject: Re: [perl #133610] [RFC] feature sysio_bytes
Date: Mon, 29 Oct 2018 16:36:00 +0100
On Mon, Oct 29, 2018 at 5:03 AM Tony Cook via RT <perlbug-followup@perl.org> wrote:
Show quoted text
On Fri, 26 Oct 2018 14:20:59 -0700, LeonT wrote:
> What is the use-case of this feature?
>
> I'm not really seeing any new possibilities, or even better syntax for old
> possibilities.

The intent is to make sensible behaviour for these operators available even if the handle has the :utf8 flag.

I would have preferred (at the #125760 timeframe) to make these ops just work in file bytes, whatever layers had been pushed, but that would have been a silent change in behaviour and hence Bad(tm).

Of course, someone who wants such sane behaviour could just:

  binmode($foo);

Tony

It already requires performing a binmode (or an equivalent open) to get the handle in a utf8-state, your proposal boils down to doing two actions that cancel each other out to reach the default state again. Surely the sensible solution is to get rid of that binmode $handle, ':utf8';

I genuinely can't think of any scenario where one would want to use this feature.

Leon
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 853b
On Mon, 22 Oct 2018 17:13:55 -0700, tonyc wrote: Show quoted text
> In [perl #125760] I suggested obsoleting sysread and syswrite on :utf8 > handles, and after some discussion on #p5p, also deprecated send and > recv on :utf8 handles. > > With 5c0551aafb45d343b720500fd9560ffedd9607fa the deprecation was > carried through and these operators now croak when used on a :utf8 > handle. > > So how can we get to a saner behaviour for these operators without > silently changing the behaviour of existing code? > > The attached patches add a new feature that prevents these operators > from croaking when used on a :utf8 handle, but also makes them work in > bytes, rather then the sketchy way they did before. > > This feature is currently not part of any version feature bundles, but > this could change.
Rejecting, since the only responses have been negative. Tony


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org