Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the YAML CPAN distribution.

Report information
The Basics
Id: 53452
Status: rejected
Priority: 0/
Queue: YAML

People
Owner: Nobody in particular
Requestors: pc88mxer [...] gmail.com
schroeer [...] cpan.org
Cc:
AdminCc:

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



Subject: YAML 0.71 changed default encoding for YAML::LoadFile?
After installing YAML-0.71, some unit tests for HTTP-Body-1.05 fail. Looks like YAML::LoadFile() now assumes the file is encoded using utf-8 whereas before it didn't - or maybe something else is going on.

Here are the HTTP-Body test failures:

t/05urlencoded.t ... 1/31
#   Failed test '001 UrlEncoded param'
#   at t/05urlencoded.t line 32.
#     Structures begin differing at:
#          $got->{text2} = 'åäöåäö'
#     $expected->{text2} = 'åäöåäö'
 
#   Failed test '003 UrlEncoded param'
#   at t/05urlencoded.t line 32.
#     Structures begin differing at:
#          $got->{text2} = 'åäöåäö'
#     $expected->{text2} = 'åäöåäö'
# Looks like you failed 2 tests of 31.
 
Subject: Re: [rt.cpan.org #53452] YAML 0.71 changed default encoding for YAML::LoadFile?
Date: Thu, 7 Jan 2010 21:31:30 +1100
To: bug-YAML [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
I didn't make the actual change, but as I understand it YAML is defined as being Unicode? 2010/1/7 E R via RT <bug-YAML@rt.cpan.org>: Show quoted text
> Wed Jan 06 18:12:37 2010: Request 53452 was acted upon. > Transaction: Ticket created by pc88mxer@gmail.com >       Queue: YAML >     Subject: YAML 0.71 changed default encoding for YAML::LoadFile? >   Broken in: 0.71 >    Severity: Normal >       Owner: Nobody >  Requestors: pc88mxer@gmail.com >      Status: new >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=53452 > > > > After installing YAML-0.71, some unit tests for HTTP-Body-1.05 fail. Looks like > YAML::LoadFile() now assumes the file is encoded using utf-8 whereas before it > didn't - or maybe something else is going on. > > Here are the HTTP-Body test failures: > > t/05urlencoded.t ... 1/31# Failed test '001 UrlEncoded param'# at > t/05urlencoded.t line 32.# Structures begin differing at:# $got->{text2} = > 'åäöåäö'# $expected->{text2} = 'åäöåäö' # Failed test '003 UrlEncoded > param'# at t/05urlencoded.t line 32.# Structures begin differing at:# > $got->{text2} = 'åäöåäö'# $expected->{text2} = 'åäöåäö'# Looks like you > failed 2 tests of 31. > >
Subject: Re: [rt.cpan.org #53452] YAML 0.71 changed default encoding for YAML::LoadFile?
Date: Thu, 7 Jan 2010 09:06:21 -0600
To: bug-YAML [...] rt.cpan.org
From: E R <pc88mxer [...] gmail.com>
On Thu, Jan 7, 2010 at 4:52 AM, Reserved Local Account via RT <bug-YAML@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=53452 > > > I didn't make the actual change, but as I understand it YAML is > defined as being Unicode?
it very well be that it is HTTP-Body's problem - there's a ticket about this filed with them as well. HTTP-Body passes all of its tests with YAML-0.70 but not with 0.71. Show quoted text
> > > 2010/1/7 E R via RT <bug-YAML@rt.cpan.org>:
>> Wed Jan 06 18:12:37 2010: Request 53452 was acted upon. >> Transaction: Ticket created by pc88mxer@gmail.com >>       Queue: YAML >>     Subject: YAML 0.71 changed default encoding for YAML::LoadFile? >>   Broken in: 0.71 >>    Severity: Normal >>       Owner: Nobody >>  Requestors: pc88mxer@gmail.com >>      Status: new >>  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=53452 > >> >> >> After installing YAML-0.71, some unit tests for HTTP-Body-1.05 fail. Looks like >> YAML::LoadFile() now assumes the file is encoded using utf-8 whereas before it >> didn't - or maybe something else is going on. >> >> Here are the HTTP-Body test failures: >> >> t/05urlencoded.t ... 1/31# Failed test '001 UrlEncoded param'# at >> t/05urlencoded.t line 32.# Structures begin differing at:# $got->{text2} = >> 'åäöåäö'# $expected->{text2} = 'åäöåäö' # Failed test '003 UrlEncoded >> param'# at t/05urlencoded.t line 32.# Structures begin differing at:# >> $got->{text2} = 'åäöåäö'# $expected->{text2} = 'åäöåäö'# Looks like you >> failed 2 tests of 31. >> >>
> >
On Wed Jan 06 18:12:37 2010, pc88mxer@gmail.com wrote:
Show quoted text
> After installing YAML-0.71, some unit tests for HTTP-Body-1.05 fail.
> Looks like
> YAML::LoadFile() now assumes the file is encoded using utf-8 whereas
> before it
> didn't - or maybe something else is going on.
>
> Here are the HTTP-Body test failures:
>
> t/05urlencoded.t ... 1/31# Failed test '001 UrlEncoded param'# at
> t/05urlencoded.t line 32.# Structures begin differing at:# $got-
> >{text2} =
> 'åäöåäö'# $expected->{text2} = 'åäöåäö' # Failed test '003
> UrlEncoded
> param'# at t/05urlencoded.t line 32.# Structures begin differing at:#
> $got->{text2} = 'åäöåäö'# $expected->{text2} = 'åäöåäö'# Looks
> like you
> failed 2 tests of 31.

I have the same issue, HTTP::Body fails its tests after YAML was changed in the recent revision.  This is causing Catalyst to no longer be installable without force or a distropref.  I'm not certain if this is a false positive test failure for HTTP::Body or not.

Any thoughts on the best way to coordinate solving this?  I don't know enough about utf8 myself to really help, although my suspicion is that this test failure in HTTP::Body is bogus, given how many people are using it with Catalyst without trouble.


Subject: Re: [rt.cpan.org #53452] YAML 0.71 changed default encoding for YAML::LoadFile?
Date: Thu, 7 Jan 2010 14:25:53 -0600
To: bug-YAML [...] rt.cpan.org
From: E R <pc88mxer [...] gmail.com>
On Thu, Jan 7, 2010 at 2:13 PM, John Napiorkowski via RT <bug-YAML@rt.cpan.org> wrote: Show quoted text
> > Any thoughts on the best way to coordinate solving this? I don't know enough > about utf8 myself to really help, although my suspicion is that this test > failure in HTTP::Body is bogus, given how many people are using it with > Catalyst without trouble.
Yeah - I'm sure it's not a real problem. My guess is that the fix is modify the file t/data/urlencoded/001-results.yml and change the line which begins: text2: <C3><A5>... (note that this is how the file appears in a pager like less. The <C3> and <A5> are single bytes in the file.) Each of these bytes needs to be UTF-8 encoded, so that the replacement line would look like: text2: <C3><83><C2><A5>... e.g. running the file through this script: use Encode; while (<>) { print Encode::encode('utf-8', $_); } Note - this is not tested, but I'm pretty sure this is the issue.
FWIW, I just posted a solution for HTTP::Body in the ticket #53424. It untangles the relation between YAML::LoadFile and HTTP::Body and in fact that seems like the only option available.
Am Mi 06. Jan 2010, 18:12:37, pc88mxer@gmail.com schrieb: Show quoted text
> After installing YAML-0.71, some unit tests for HTTP-Body-1.05 fail. > Looks like > YAML::LoadFile() now assumes the file is encoded using utf-8 whereas > before it > didn't - or maybe something else is going on.
This is really a change that was introduced in version 0.71 and that is documented in the Changes file, but nowhere in the docs. I'd also like to point out that this change makes scripts fail that were working before. That's when the script loads a file in eg. iso-8859-1 encoding. Afaics this was allowed before and I imagine the number of scripts doing so to be quite high.
I fixed RT#25434 in 0.71 release. Most YAML implementation in Perl are buggy regarding encoding, and this must be fixed as CPAN is now relying more and more on META.yml. A strict encoding is important for interoperability. In previous releases, the file encoding used was the local one, which is dependent on the environnement writing the file and the environment reading it and they may differ on their defaults. YAML::Tiny still has to be fixed (RT#48885). So if HTTP::Body has invalid YAML files in its test suite, thoses files must be fixed. -- Olivier Mengué - http://o.mengue.free.fr/
This issue has been copied to: https://github.com/ingydotnet/yaml-pm/issues/102 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
It looks like this can be closed. Please reopen if necessary.