Skip Menu |
 

This queue is for tickets about the URI CPAN distribution.

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

People
Owner: ether [...] cpan.org
Requestors: ether [...] cpan.org
Cc: IKEGAMI [...] cpan.org
AdminCc:

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



Subject: Usage of \C now gives deprecation warning in 5.21.2 and higher
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-24776-1404497763-1840.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 209
Download (untitled) / with headers
text/plain 209b
URI::Escape uses \C to parse the string to be escaped and should be fixed. Given how this breaks UTF-8 string parsing, I'm wondering if its usage has always been buggy; perhaps we need more tests for UTF-8.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-24776-1404497763-1840.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-24776-1404497763-1840.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-30035-1404591379-616.96941-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1015
Download (untitled) / with headers
text/plain 1015b
On Fri Jul 04 14:16:04 2014, ETHER wrote: Show quoted text
> URI::Escape uses \C to parse the string to be escaped and should be > fixed. > > Given how this breaks UTF-8 string parsing, I'm wondering if its usage > has always been buggy; perhaps we need more tests for UTF-8.
\C is only used by an undocumented function that's not used by the module. The function is indeed buggy as it can encode identical strings differently. $ perl -MURI::Escape -wE'$_="\xE9"; utf8::downgrade($_); say URI::Escape::escape_char($_);' %E9 $ perl -MURI::Escape -wE'$_="\xE9"; utf8::upgrade($_); say URI::Escape::escape_char($_);' %C3%A9 The following version of escape_char behaves identically, but doesn't use \C: # XXX escape_char is buggy as it assigns meaning to the string's storage format. sub escape_char { if (utf8::is_utf8($_[0])) { my $s = $_[0]; utf8::encode($s); unshift(@_, $s); } return join '', @URI::Escape::escapes{$_[0] =~ /(.)/g}; }
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-30035-1404591379-616.96941-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-24776-1404497763-1840.0-0-0 [...] rt.cpan.org> <rt-4.0.18-30035-1404591379-616.96941-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-14166-1404591831-1465.96941-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 452
Download (untitled) / with headers
text/plain 452b
On Sat Jul 05 16:16:19 2014, ikegami wrote: Show quoted text
> \C is only used by an undocumented function that's not used by the > module. > > The function is indeed buggy as it can encode identical strings > differently.
It is used by URI->new, though. URI->new is buggy :( $ perl -MURI -wE'$_="http://foo/\xE9"; utf8::upgrade($_); say URI->new($_);' http://foo/%C3%A9 $ perl -MURI -wE'$_="http://foo/\xE9"; utf8::downgrade($_); say URI->new($_);' http://foo/%E9
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-30035-1404591379-616.96941-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-24776-1404497763-1840.0-0-0 [...] rt.cpan.org> <rt-4.0.18-30035-1404591379-616.96941-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-31513-1404835038-1187.96941-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 447
Download (untitled) / with headers
text/plain 447b
On Sat Jul 05 16:16:19 2014, ikegami wrote: Show quoted text
> The following version of escape_char behaves identically, but doesn't > use \C: > > # XXX escape_char is buggy as it assigns meaning to the string's > storage format. > sub escape_char { > if (utf8::is_utf8($_[0])) { > my $s = $_[0]; > utf8::encode($s); > unshift(@_, $s); > } > > return join '', @URI::Escape::escapes{$_[0] =~ /(.)/g}; > }
That should be /(.)/sg.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-24776-1404497763-1840.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-24776-1404497763-1840.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-11316-1405136585-190.96941-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 22
Thanks, 1.62 released!
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-11316-1405136585-190.96941-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-24776-1404497763-1840.0-0-0 [...] rt.cpan.org> <rt-4.0.18-11316-1405136585-190.96941-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-1038-1405224340-423.96941-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 314
Download (untitled) / with headers
text/plain 314b
Unfortunately this fix causes other tests to fail on perls earlier than 5.12.1: https://rt.cpan.org/Ticket/Display.html?id=97177 I'm not sure if this is a resolvable situation, but regardless, the way in which strings are parsed in this module need to be reconsidered with respect to the utf8 flags on the string.
CC: IKEGAMI [...] cpan.org
MIME-Version: 1.0
X-Spam-Status: No, score=-4.598 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, FROM_OUR_RT=-2, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
In-Reply-To: <rt-4.0.18-1038-1405224340-1136.96941-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-96941 [...] rt.cpan.org> <rt-4.0.18-24776-1404497763-1840.96941-6-0 [...] rt.cpan.org> <rt-4.0.18-11316-1405136585-190.96941-6-0 [...] rt.cpan.org> <rt-4.0.18-1038-1405224340-1136.96941-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Received: by 10.60.116.166 with SMTP id jx6mr9604189oeb.6.1405225844471; Sat, 12 Jul 2014 21:30:44 -0700 (PDT)
Message-ID: <CALJW-qHXkZGMj+o0+=TQGHrOjE1vk1OSp3SpCJNQqiBDOfUf=A [...] mail.gmail.com>
Content-Type: multipart/alternative; boundary="089e0129534e49fc8e04fe0ba3cd"
X-Spam-Score: -4.598
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 5D1112409EA for <cpan-bug+URI [...] hipster.bestpractical.com>; Sun, 13 Jul 2014 00:30:52 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WKMQ+hQrlHZZ for <cpan-bug+URI [...] hipster.bestpractical.com>; Sun, 13 Jul 2014 00:30:51 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 0111D2409E4 for <bug-URI [...] rt.cpan.org>; Sun, 13 Jul 2014 00:30:50 -0400 (EDT)
Received: (qmail 27613 invoked by alias); 13 Jul 2014 04:30:50 -0000
Received: from mail-oa0-f43.google.com (HELO mail-oa0-f43.google.com) (209.85.219.43) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sat, 12 Jul 2014 21:30:48 -0700
Received: by mail-oa0-f43.google.com with SMTP id i7so1942567oag.16 for <bug-URI [...] rt.cpan.org>; Sat, 12 Jul 2014 21:30:44 -0700 (PDT)
Received: by 10.182.144.166 with HTTP; Sat, 12 Jul 2014 21:30:44 -0700 (PDT)
Delivered-To: cpan-bug+URI [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #96941] Usage of \C now gives deprecation warning in 5.21.2 and higher
Return-Path: <ikesuke [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=GllLz+BVPJ4R1WNucr+XAeFPYWoqF55kU2B31npqs3M=; b=uQGd0lYUrGGtqGzdSu9VDaOLu6iEub6N5d1VVGM1gK4zRizhPpmM4f3MINue2zbcyp 2q5CGwd/Y8w8LNn5os+9+tUvKg0S+reWd36MKK7vLVY+at0Ln9BkasRC1SerkO+4hIZ4 6DtAKIkM1C6HSUJMMOGMzqT8IjIpSObLMOROGmgDGP1m77uZkXGbTZzwYUIE88HyPzVQ WYBXpyhtFSzWharfKWTkkfH8zvwGwN7hCRTStFLn5S8VNndqVSQv0XDDLjukMarYoFas W+NyPprMaY51leEEyPzKBulzfBMAtdmO65lHbDzv6qiftRjyh5QpMLPkOX3c2dMJPAnt UJ6w==
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+URI [...] hipster.bestpractical.com
X-RT-Mail-Extension: uri
X-Google-Sender-Auth: LnQqNWwJlQTWlscp2hmmtf_K3VY
Sender: ikesuke [...] gmail.com
Date: Sun, 13 Jul 2014 00:30:44 -0400
X-Spam-Level:
To: bug-URI [...] rt.cpan.org
From: Eric Brine <ikegami [...] adaelis.com>
RT-Message-ID: <rt-4.0.18-345-1405225853-655.96941-0-0 [...] rt.cpan.org>
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 512
Download (untitled) / with headers
text/plain 512b
I'll have a look at it tomorrow. On Sun, Jul 13, 2014 at 12:05 AM, Karen Etheridge via RT < bug-URI@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=96941 > > > Unfortunately this fix causes other tests to fail on perls earlier than > 5.12.1: https://rt.cpan.org/Ticket/Display.html?id=97177 > > I'm not sure if this is a resolvable situation, but regardless, the way in > which strings are parsed in this module need to be reconsidered with > respect to the utf8 flags on the string. >
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 986
CC: ether [...] cpan.org, IKEGAMI [...] cpan.org
MIME-Version: 1.0
X-Spam-Status: No, score=-4.598 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, FROM_OUR_RT=-2, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
In-Reply-To: <rt-4.0.18-345-1405225853-1597.96941-6-0 [...] rt.cpan.org>
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-96941 [...] rt.cpan.org> <rt-4.0.18-24776-1404497763-1840.96941-6-0 [...] rt.cpan.org> <rt-4.0.18-11316-1405136585-190.96941-6-0 [...] rt.cpan.org> <rt-4.0.18-1038-1405224340-1136.96941-6-0 [...] rt.cpan.org> <CALJW-qHXkZGMj+o0+=TQGHrOjE1vk1OSp3SpCJNQqiBDOfUf=A [...] mail.gmail.com> <rt-4.0.18-345-1405225853-1597.96941-6-0 [...] rt.cpan.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Received: by 10.60.62.148 with SMTP id y20mr67782oer.80.1405235424775; Sun, 13 Jul 2014 00:10:24 -0700 (PDT)
Message-ID: <CALJW-qHcibckSmkoE_HKOwsOyhg9n86vCVWFDZSa-gZXJCYD3w [...] mail.gmail.com>
Content-Type: multipart/alternative; boundary="047d7b67017f51d67704fe0dde12"
X-Spam-Score: -4.598
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] gmail.com
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 1DA172409EF for <cpan-bug+URI [...] hipster.bestpractical.com>; Sun, 13 Jul 2014 03:10:33 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vScPTFUibcOi for <cpan-bug+URI [...] hipster.bestpractical.com>; Sun, 13 Jul 2014 03:10:31 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id A558F2409EA for <bug-URI [...] rt.cpan.org>; Sun, 13 Jul 2014 03:10:31 -0400 (EDT)
Received: (qmail 2468 invoked by alias); 13 Jul 2014 07:10:30 -0000
Received: from mail-ob0-f172.google.com (HELO mail-ob0-f172.google.com) (209.85.214.172) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sun, 13 Jul 2014 00:10:28 -0700
Received: by mail-ob0-f172.google.com with SMTP id wn1so2951751obc.17 for <bug-URI [...] rt.cpan.org>; Sun, 13 Jul 2014 00:10:24 -0700 (PDT)
Received: by 10.182.144.166 with HTTP; Sun, 13 Jul 2014 00:10:24 -0700 (PDT)
Delivered-To: cpan-bug+URI [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #96941] Usage of \C now gives deprecation warning in 5.21.2 and higher
Return-Path: <ikesuke [...] gmail.com>
Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=xCYaxgVr7fAI1ZGKslO+wHB8heJA0R72uzwPEVmWE6w=; b=WA2H0wo+dCJGrzN2g7bpjTDfjo/7hzPfLEFt0eAQ5Yj651lRX5d3WbVu5J/kN6YRmq 7dyVOize5cgxBWJXAiaYH0vrmhDZrnV3FyXl6TRLcdE8Yu1J7GYtGzy5Zr57hui6gANE weDE36e6iVNK78jdXJlApme8gH5Hnz4iP4zBtl7/kzEq59qvJdRaW9BoT0AD1lN44ydx o0gUT8c7vIzXTfefQY+b6bFE4EWvVgxw68ufgkH9yA47s+r0Ir4umPWVZNEYa8b2jw3e cNDKJ9tDOBhAY9FooisgkGZikhhdGwZA6l3NJrL8HkQeREj3+6HyHeib8EfFEq0QXtXM Hz4g==
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+URI [...] hipster.bestpractical.com
X-RT-Mail-Extension: uri
X-Google-Sender-Auth: e5dxXSaqqn5ugkVHnnbW49jo2xc
Sender: ikesuke [...] gmail.com
Date: Sun, 13 Jul 2014 03:10:24 -0400
X-Spam-Level:
To: bug-URI [...] rt.cpan.org
From: Eric Brine <ikegami [...] adaelis.com>
RT-Message-ID: <rt-4.0.18-345-1405235433-845.96941-0-0 [...] rt.cpan.org>
Content-Length: 0
content-type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
Content-Length: 1231
Download (untitled) / with headers
text/plain 1.2k
On Sun, Jul 13, 2014 at 12:05 AM, Karen Etheridge via RT < bug-URI@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=96941 > > > Unfortunately this fix causes other tests to fail on perls earlier than > 5.12.1: https://rt.cpan.org/Ticket/Display.html?id=97177
Your encountering a bug in utf8::is_utf8 that occurs when escape_char($1) is performed. Fix follows: (Tested with 5.10.1) # XXX FIXME escape_char is buggy as it assigns meaning to the string's storage format. sub escape_char { # Old versions of utf8::is_utf8() didn't properly handle magical vars (e.g. $1). # The following forces a fetch to occur beforehand. my $dummy = substr($_[0], 0, 0); if (utf8::is_utf8($_[0])) { my $s = shift; utf8::encode($s); unshift(@_, $s); } return join '', @URI::Escape::escapes{$_[0] =~ /(.)/sg}; } Note that split // is faster than /./sg, so you might want to use: (Tested with 5.10.1) return join '', @URI::Escape::escapes{split //, $_[0]}; One of your test files uses subtest() from Test::More. Note that subtest() wasn't in Test::More 0.92, the Test::More that comes with 5.10.1. You might want to bump the prereq version of Test::More to 0.94. - Eric
content-type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-RT-Original-Encoding: utf-8
Content-Length: 1714
CC: bug-URI [...] rt.cpan.org, IKEGAMI [...] cpan.org
X-Sa-Exim-Connect-Ip: 69.50.167.197
MIME-Version: 1.0
X-Spam-Status: No, score=-3.265 tagged_above=-99.9 required=10 tests=[AWL=0.635, BAYES_00=-1.9, FROM_OUR_RT=-2] autolearn=ham
In-Reply-To: <CALJW-qHcibckSmkoE_HKOwsOyhg9n86vCVWFDZSa-gZXJCYD3w [...] mail.gmail.com>
Content-Disposition: inline
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-96941 [...] rt.cpan.org> <rt-4.0.18-24776-1404497763-1840.96941-6-0 [...] rt.cpan.org> <rt-4.0.18-11316-1405136585-190.96941-6-0 [...] rt.cpan.org> <rt-4.0.18-1038-1405224340-1136.96941-6-0 [...] rt.cpan.org> <CALJW-qHXkZGMj+o0+=TQGHrOjE1vk1OSp3SpCJNQqiBDOfUf=A [...] mail.gmail.com> <rt-4.0.18-345-1405225853-1597.96941-6-0 [...] rt.cpan.org> <CALJW-qHcibckSmkoE_HKOwsOyhg9n86vCVWFDZSa-gZXJCYD3w [...] mail.gmail.com>
X-Acl-Warn: !authenticated = *
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <20140713211800.GJ242 [...] tequila>
content-type: text/plain; charset="utf-8"
X-Spam-Score-Int: 0
X-RT-Original-Encoding: utf-8
X-Spam-Score: -3.265
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id D339161E00B for <cpan-bug+URI [...] hipster.bestpractical.com>; Sun, 13 Jul 2014 17:18:13 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gZVfDy9Xiove for <cpan-bug+URI [...] hipster.bestpractical.com>; Sun, 13 Jul 2014 17:18:12 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 5D2F124031E for <bug-URI [...] rt.cpan.org>; Sun, 13 Jul 2014 17:18:12 -0400 (EDT)
Received: (qmail 27159 invoked by alias); 13 Jul 2014 21:18:10 -0000
Received: from ns2.lightspeed.ca (HELO www.lightspeed.ca) (206.12.82.4) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sun, 13 Jul 2014 14:18:07 -0700
Received: from 69-50-167-197.westerncable.ca ([69.50.167.197] helo=etheridge.ca) by www.lightspeed.ca with esmtp (Exim 4.80) (envelope-from <ether [...] cpan.org>) id 1X6R9l-0007lw-L6; Sun, 13 Jul 2014 14:18:01 -0700
Delivered-To: cpan-bug+URI [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #96941] Usage of \C now gives deprecation warning in 5.21.2 and higher
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Sa-Exim-Mail-From: ether [...] cpan.org
Return-Path: <ether [...] cpan.org>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+URI [...] hipster.bestpractical.com
X-RT-Mail-Extension: uri
Date: Sun, 13 Jul 2014 14:18:00 -0700
X-Sa-Exim-Scanned: No (on www.lightspeed.ca); SAEximRunCond expanded to false
X-Spam-Level:
X-Spam-Bar: /
To: Eric Brine <ikegami [...] adaelis.com>
From: Karen Etheridge <ether [...] cpan.org>
RT-Message-ID: <rt-4.0.18-5131-1405286294-1347.96941-0-0 [...] rt.cpan.org>
Content-Length: 218
Download (untitled) / with headers
text/plain 218b
On Sun, Jul 13, 2014 at 03:10:24AM -0400, Eric Brine wrote: Show quoted text
> Your encountering a bug in utf8::is_utf8 that occurs when escape_char($1) > is performed. Fix follows: (Tested with 5.10.1)
All released in 1.64. thanks!
CC: bug-URI [...] rt.cpan.org, IKEGAMI [...] cpan.org
X-Sa-Exim-Connect-Ip: 69.50.167.197
MIME-Version: 1.0
X-Spam-Status: No, score=-3.273 tagged_above=-99.9 required=10 tests=[AWL=0.627, BAYES_00=-1.9, FROM_OUR_RT=-2] autolearn=ham
In-Reply-To: <CALJW-qHcibckSmkoE_HKOwsOyhg9n86vCVWFDZSa-gZXJCYD3w [...] mail.gmail.com>
Content-Disposition: inline
X-Spam-Flag: NO
X-RT-Interface: API
References: <RT-Ticket-96941 [...] rt.cpan.org> <rt-4.0.18-24776-1404497763-1840.96941-6-0 [...] rt.cpan.org> <rt-4.0.18-11316-1405136585-190.96941-6-0 [...] rt.cpan.org> <rt-4.0.18-1038-1405224340-1136.96941-6-0 [...] rt.cpan.org> <CALJW-qHXkZGMj+o0+=TQGHrOjE1vk1OSp3SpCJNQqiBDOfUf=A [...] mail.gmail.com> <rt-4.0.18-345-1405225853-1597.96941-6-0 [...] rt.cpan.org> <CALJW-qHcibckSmkoE_HKOwsOyhg9n86vCVWFDZSa-gZXJCYD3w [...] mail.gmail.com>
X-Acl-Warn: !authenticated = *
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <20140713211906.GK242 [...] tequila>
content-type: text/plain; charset="utf-8"
X-Spam-Score-Int: 0
X-RT-Original-Encoding: utf-8
X-Spam-Score: -3.273
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 5FDA561E00D for <cpan-bug+URI [...] hipster.bestpractical.com>; Sun, 13 Jul 2014 17:19:14 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id x4QHZCwKis0F for <cpan-bug+URI [...] hipster.bestpractical.com>; Sun, 13 Jul 2014 17:19:13 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 4695524031E for <bug-URI [...] rt.cpan.org>; Sun, 13 Jul 2014 17:19:13 -0400 (EDT)
Received: (qmail 27308 invoked by alias); 13 Jul 2014 21:19:12 -0000
Received: from ns2.lightspeed.ca (HELO www.lightspeed.ca) (206.12.82.4) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Sun, 13 Jul 2014 14:19:09 -0700
Received: from 69-50-167-197.westerncable.ca ([69.50.167.197] helo=etheridge.ca) by www.lightspeed.ca with esmtp (Exim 4.80) (envelope-from <ether [...] cpan.org>) id 1X6RAo-0007m4-ON; Sun, 13 Jul 2014 14:19:06 -0700
Delivered-To: cpan-bug+URI [...] hipster.bestpractical.com
Subject: Re: [rt.cpan.org #96941] Usage of \C now gives deprecation warning in 5.21.2 and higher
User-Agent: Mutt/1.5.21 (2010-09-15)
X-Sa-Exim-Mail-From: ether [...] cpan.org
Return-Path: <ether [...] cpan.org>
X-Spam-Check-BY: la.mx.develooper.com
X-Original-To: cpan-bug+URI [...] hipster.bestpractical.com
X-RT-Mail-Extension: uri
Date: Sun, 13 Jul 2014 14:19:06 -0700
X-Sa-Exim-Scanned: No (on www.lightspeed.ca); SAEximRunCond expanded to false
X-Spam-Level:
X-Spam-Bar: /
To: Eric Brine <ikegami [...] adaelis.com>
From: Karen Etheridge <ether [...] cpan.org>
RT-Message-ID: <rt-4.0.18-23240-1405286355-151.96941-0-0 [...] rt.cpan.org>
Content-Length: 1133
Download (untitled) / with headers
text/plain 1.1k
(resent, due to mailer issue) On Sun, Jul 13, 2014 at 03:10:24AM -0400, Eric Brine wrote: Show quoted text
> Your encountering a bug in utf8::is_utf8 that occurs when escape_char($1) > is performed. Fix follows: (Tested with 5.10.1) > # Old versions of utf8::is_utf8() didn't properly handle magical vars (e.g. $1). > # The following forces a fetch to occur beforehand. > my $dummy = substr($_[0], 0, 0);
Interesting; can you explain what's going on here and why adding this line helps? Show quoted text
> if (utf8::is_utf8($_[0])) { > my $s = shift;
This change looks like we were mistakenly adding an extra argument to @_ previously... Show quoted text
> Note that split // is faster than /./sg, so you might want to use: (Tested > with 5.10.1)
I was considering that earlier (wondering why we were even matching on \C or . in the first place), but on its own it didn't help anything. But, agreed that it's faster. Show quoted text
> One of your test files uses subtest() from Test::More. Note that subtest() > wasn't in Test::More 0.92, the Test::More that comes with 5.10.1. You might > want to bump the prereq version of Test::More to 0.94.
Thanks, well spotted!


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.