develooper Front page | perl.perl5.porters | Postings from June 2016

[perl #128365] IO layer for STDERR not set

From:
E . Choroba
Date:
June 11, 2016 22:14
Subject:
[perl #128365] IO layer for STDERR not set
Message ID:
rt-4.0.18-22936-1465548643-90.128365-75-0@perl.org
# New Ticket Created by  E. Choroba 
# Please include the string:  [perl #128365]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=128365 >


This is a bug report for perl from choroba@cpan.org,
generated with the help of perlbug 1.39 running under perl 5.18.2.


-----------------------------------------------------------------
[Please describe your issue here]

When reopening STDERR, its encoding layer doesn't change.

     #!/usr/bin/perl
     use strict;
     use warnings;
     use utf8;

     open STDERR, '>:utf8' , 'perl.log' or die $!;
     print STDERR "(é'-è_çà)\n";
     binmode STDERR, ':utf8';
     print STDERR "(é'-è_çà)\n";

Output (contents of the perl.log file):

(???)
(éèçà)

Expected output (works OK if I use LOG instead of STDERR, or my $LOG,
or close STDERR before opening):

(éèçà)
(éèçà)

Origin: http://www.perlmonks.org/?node_id=1165214

Ch.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
     category=core
     severity=low
---
This perlbug was built using Perl 5.18.2 - Sun Oct 25 05:48:43 UTC 2015
It is being executed now by  Perl 5.18.2 - Sun Oct 25 05:46:02 UTC 2015.

Site configuration information for perl 5.18.2:

Configured by abuild at Sun Oct 25 05:46:02 UTC 2015.

Summary of my perl5 (revision 5 version 18 subversion 2) configuration:

   Platform:
     osname=linux, osvers=4.1.10-1-default, archname=x86_64-linux-thread-multi
     uname='linux cloud105 4.1.10-1-default #1 smp preempt mon oct 12 11:24:48 utc 2015 (67a24e6) x86_64 x86_64 x86_64 gnulinux '
     config_args='-ds -e -Dprefix=/usr -Dvendorprefix=/usr -Dinstallusrbinperl -Dusethreads -Di_db -Di_dbm -Di_ndbm -Di_gdbm -Dd_dbm_open -Duseshrplib=true -Doptimize=-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe -Accflags=-DPERL_USE_SAFE_PUTENV -Dotherlibdirs=/usr/lib/perl5/site_perl -Dinc_version_list=5.18.0/x86_64-linux-thread-multi 5.18.0 5.18.1/x86_64-linux-thread-multi 5.18.1'
     hint=recommended, useposix=true, d_sigaction=define
     useithreads=define, usemultiplicity=define
     useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
     use64bitint=define, use64bitall=define, uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
     optimize='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -Wall -pipe',
     cppflags='-D_REENTRANT -D_GNU_SOURCE -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -fstack-protector'
     ccversion='', gccversion='4.8.5', gccosandvers=''
     intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
     d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
     ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
     alignbytes=8, prototype=define
   Linker and Libraries:
     ld='cc', ldflags =' -L/usr/local/lib64 -fstack-protector'
     libpth=/lib64 /usr/lib64 /usr/local/lib64
     libs=-lm -ldl -lcrypt -lpthread
     perllibs=-lm -ldl -lcrypt -lpthread
     libc=/lib64/libc-2.19.so, so=so, useshrplib=true, libperl=libperl.so
     gnulibc_version='2.19'
   Dynamic Linking:
     dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/CORE'
     cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64 -fstack-protector'

Locally applied patches:


---
@INC for perl 5.18.2:
     /home/choroba/perl5/lib/perl5/5.18.2/x86_64-linux-thread-multi
     /home/choroba/perl5/lib/perl5/5.18.2
     /home/choroba/perl5/lib/perl5/x86_64-linux-thread-multi
     /home/choroba/perl5/lib/perl5
     /usr/lib/perl5/site_perl/5.18.2/x86_64-linux-thread-multi
     /usr/lib/perl5/site_perl/5.18.2
     /usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi
     /usr/lib/perl5/vendor_perl/5.18.2
     /usr/lib/perl5/5.18.2/x86_64-linux-thread-multi
     /usr/lib/perl5/5.18.2
     /home/choroba/perl5/lib/perl5/5.18.1
     /usr/lib/perl5/site_perl
     .

---
Environment for perl 5.18.2:
     HOME=/home/choroba
     LANG=en_US.UTF-8
     LANGUAGE (unset)
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
     PATH=/home/choroba/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/home/choroba/perl5/bin:.
     PERL5LIB=/home/choroba/perl5/lib/perl5
     PERL_BADLANG (unset)
     PERL_LOCAL_LIB_ROOT=/home/choroba/perl5
     PERL_MB_OPT=--install_base "/home/choroba/perl5"
     PERL_MM_OPT=INSTALL_BASE=/home/choroba/perl5
     SHELL=/bin/bash




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About