Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the IO-All CPAN distribution.

Report information
The Basics
Id: 68512
Status: resolved
Priority: 0/
Queue: IO-All

People
Owner: Nobody in particular
Requestors: brbpub [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: IO::All::encoding() fails for stdio objects
Date: Fri, 27 May 2011 14:21:10 -0400
To: bug-IO-All [...] rt.cpan.org
From: Bernardo Rechea <brbpub [...] gmail.com>
IO::All::encoding() calls    CORE::binmode($self->io_handle, ":$encoding") if $self->is_open; which applies to stdio handles (preopened by perl). If the io_handle is not opened, when IO::All::open() is called later it calls   $self->set_binmode; which, in turns, calls:   CORE::binmode($self->io_handle, ":encoding($encoding)"); Thus the following catch-22: creating an IO::All object with a variable name io($name), then setting the encoding, will fail for stdio (i.e., if the supplied $name is '-' or '='); trying to work around this by setting the encoding to 'encoding($myOrigEncoding)' will now fail for non-stdio objects. Changing CORE::binmode($self->io_handle, ":$encoding") to     CORE::binmode($self->io_handle, ":encoding($encoding)") in encoding() to be consistent with what's done in set_binmode() fixes this bug. Thanks. Bernardo Rechea
On Fri May 27 14:21:17 2011, brbpub@gmail.com wrote: Show quoted text
> IO::All::encoding() calls > >    CORE::binmode($self->io_handle, ":$encoding") if $self->is_open; > > which applies to stdio handles (preopened by perl). > > If the io_handle is not opened, when IO::All::open() is called later > it calls > >   $self->set_binmode; > > which, in turns, calls: > >   CORE::binmode($self->io_handle, ":encoding($encoding)"); > > Thus the following catch-22: creating an IO::All object with a > variable > name io($name), then setting the encoding, will fail for stdio (i.e., > if > the supplied $name is '-' or '='); trying to work around this by > setting > the encoding to 'encoding($myOrigEncoding)' will now fail for non- > stdio > objects. > > Changing > > CORE::binmode($self->io_handle, ":$encoding") > > to > >     CORE::binmode($self->io_handle, ":encoding($encoding)") > > in encoding() to be consistent with what's done in set_binmode() fixes > this bug. > > Thanks. > Bernardo Rechea
Fixed in git, will release soon, thanks