Skip Menu |

This queue is for tickets about the URI CPAN distribution.

Report information
The Basics
Id: 59274
Status: resolved
Priority: 0/
Queue: URI

People
Owner: Nobody in particular
Requestors: ribasushi [...] leporine.io
Cc:
AdminCc:

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



Subject: Fails tests on 5.8.1
With 5.8.1 ===================== rabbit@Thesaurus:~/.cpancache/build/URI-1.54$ perl -MTest::Harness -e 'warn "\nRunning perl $]\n\n"; Test::Harness::runtests("t/iri.t")' Running perl 5.008001 t/iri.t .. 1/26 # Failed test at t/iri.t line 29. # got: 'http://example.com/B%C3%BCcher' # expected: 'http://example.com/B%FCcher' # Failed test at t/iri.t line 30. # got: 'http://example.com/Bücher' # expected: 'http://example.com/B%FCcher' # Looks like you failed 2 tests of 26. t/iri.t .. Dubious, test returned 2 (wstat 512, 0x200) Failed 2/26 subtests Test Summary Report ------------------- t/iri.t (Wstat: 512 Tests: 26 Failed: 2) Failed tests: 8-9 Non-zero exit status: 2 Files=1, Tests=26, 0 wallclock secs ( 0.03 usr 0.00 sys + 0.07 cusr 0.01 csys = 0.11 CPU) Result: FAIL Failed 1/1 test programs. 2/26 subtests failed. With 5.8.9 ================== rabbit@Thesaurus:~/.cpancache/build/URI-1.54$ perl -MTest::Harness -e 'warn "\nRunning perl $]\n\n"; Test::Harness::runtests("t/iri.t")' Running perl 5.008009 t/iri....ok All tests successful. Files=1, Tests=26, 0 wallclock secs ( 0.07 cusr + 0.02 csys = 0.09 CPU) My failing perl info: ============================== Summary of my perl5 (revision 5 version 8 subversion 9) configuration: Platform: osname=linux, osvers=2.6.29.2.thes2, archname=i686-linux-thread-multi uname='linux thesaurus 2.6.29.2.thes2 #1 preempt tue sep 8 11:27:43 cest 2009 i686 gnulinux ' config_args='-de -Dprefix=/home/rabbit/perl5/perlbrew/perls/5.8.9 -Dusethreads' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.4.4', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/lib64 libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.11.1.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.11.1' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP THREADS_HAVE_PIDS USE_FAST_STDIO USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Built under linux Compiled at Jul 5 2010 13:09:55 %ENV: PERL5LIB="/home/rabbit/devel/utils/perl:/home/rabbit/devel/utils/perl:/home/rabbit/devel/utils/perl:" PERL_AUTOINSTALL_PREFER_CPAN="1" @INC: /home/rabbit/devel/utils/perl /home/rabbit/devel/utils/perl /home/rabbit/devel/utils/perl /home/rabbit/perl5/perlbrew/perls/5.8.9/lib/5.8.9/i686-linux-thread-multi /home/rabbit/perl5/perlbrew/perls/5.8.9/lib/5.8.9 /home/rabbit/perl5/perlbrew/perls/5.8.9/lib/site_perl/5.8.9/i686-linux-thread-multi /home/rabbit/perl5/perlbrew/perls/5.8.9/lib/site_perl/5.8.9 .
Note - this module can very well be made to work on 5.6 if anyone is interested. All it needs is emulation of utf8:: routines, which are rather doable in 5.6. However I completely ran out of my allotted time to play with this ;)
 Peter's patch (the github repo link is gone).
Subject: Fix-RT-59274-courtesy-of-a-stupid-5.8.-12-join-bug.patch
From 400d2d322d90eaa68f38832639297a5519c60cd2 Mon Sep 17 00:00:00 2001 From: Peter Rabbitson <ribasushi@cpan.org> Date: Sat, 21 Jan 2012 04:41:32 +0100 Subject: [PATCH] Fix RT#59274 - courtesy of a stupid 5.8.[12] join bug --- URI-1.59/URI/_idna.pm | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/URI-1.59/URI/_idna.pm b/URI-1.59/URI/_idna.pm index 39366e5..8b9eab7 100644 --- a/URI-1.59/URI/_idna.pm +++ b/URI-1.59/URI/_idna.pm @@ -7,6 +7,13 @@ use strict; use URI::_punycode qw(encode_punycode decode_punycode); use Carp qw(croak); +BEGIN { + *URI::_idna::_ENV_::JOIN_LEAKS_UTF8_FLAGS = $] < 5.008_003 + ? sub () { 1 } + : sub () { 0 } + ; +} + my $ASCII = qr/^[\x00-\x7F]*\z/; sub encode { @@ -17,6 +24,8 @@ sub encode { for (@labels) { $_ = ToASCII($_); } + + return eval 'join(".", @labels, @last_empty)' if URI::_idna::_ENV_::JOIN_LEAKS_UTF8_FLAGS; return join(".", @labels, @last_empty); } -- 1.7.5.4
On Sun Mar 11 08:00:28 2012, GAAS wrote:
Show quoted text
> Peter's patch (the github repo link is gone).

I'm about to apply this patch, but I find hard to understand.  Why does this work and what does it mean that join leaks the UTF8 flag?
On Sun Mar 11 08:07:51 2012, GAAS wrote: Show quoted text
> On Sun Mar 11 08:00:28 2012, GAAS wrote:
> > Peter's patch (the github repo link is gone).
> > I'm about to apply this patch, but I find hard to understand. Why does
this Show quoted text
> work and what does it mean that join leaks the UTF8 flag?
The second bug listed in https://metacpan.org/module/perl583delta#Selected-Bug-Fixes. I can fully appreciate that this is a suboptimal fix (and it is properly compiled away on 5.8.3+), yet the entire stack works with it on 5.8.1, so it seemed a small price to pay.