Skip Menu |

This queue is for tickets about the DB-CouchDB-Schema CPAN distribution.

Report information
The Basics
Id: 45572
Status: new
Priority: 0/
Queue: DB-CouchDB-Schema

People
Owner: Nobody in particular
Requestors: madams [...] phantomware.ca
Cc:
AdminCc:

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



CC: jeremy [...] marzhillstudios.com
Subject: Potential bug in DB::CouchDB use of HTTP::Message?
Date: Wed, 29 Apr 2009 16:22:33 -0400
To: bug-DB-CouchDB-Schema [...] rt.cpan.org
From: madams [...] phantomware.ca
Hi: I am trying to use DB-CouchDB-Schema-0.3.04 to connect to a CouchDB database. My test implementation I am using is the same as what is listed on http://search.cpan.org/~zaphar/DB-CouchDB-Schema-0.3.04_remove_blib/lib/DB/CouchDB.pm. Data::Dumper indicates that my CouchDB document data structure is being returned as expected however I am receiving the following error message: test: Odd number of elements in hash assignment at /usr/share/perl5/HTTP/Message.pm line 181. HTTP::Message reports a $HTTP::Message::Version as 5.812 I am using Debian stable (lenny). I am not sure if DB::CouchDB is to blame for this but I thought I would send it your way in the event that you can do something about it. Thanks, Matt
CC: jeremy [...] marzhillstudios.com
Subject: Re: [rt.cpan.org #45572] AutoReply: Potential bug in DB::CouchDB use of HTTP::Message?
Date: Thu, 30 Apr 2009 00:17:16 -0400
To: bug-DB-CouchDB-Schema [...] rt.cpan.org
From: madams [...] phantomware.ca
Further to my previous email, it appears that the following patch fixes the problem: --- CouchDB.pm.dist 2009-04-29 19:42:07.000000000 -0400 +++ CouchDB.pm 2009-04-29 19:42:14.000000000 -0400 @@ -431,9 +431,7 @@ my $ua = LWP::UserAgent->new(); my $return = $ua->request($req); - my $response = $return->decoded_content({ - default_charset => 'utf8' - }); + my $response = $return->decoded_content(); my $decoded; eval { $decoded = $self->json()->decode($response); I note that the original form of CouchDB.pm attempted to force Encode::decode() in HTML::Message::decoded_content() to use the lax or liberal encoding vs. the strict UTF-8. The patch above appears to "fix" the problem but I'm left wondering if perhaps there is a reason that the original form of CouchDB.pm used the lax encoding of UTF-8. Any clarification of the choice to use utf8 vs UTF-8 would be greatly appreciated. Thanks! Matt