[ckan-dev] Mysterious bugfix in webstore-client

Friedrich Lindenberg friedrich.lindenberg at okfn.org
Wed Jul 20 20:34:37 UTC 2011


My training ground for this originally was the dashboard gathering
stuff, and the mailing list archive upload in particular. As for
debugging I've played with the code quite a bit, including encoding to
utf-8 and ascii explitly. Maybe setting an explicit Content-Type of
application/json; charset=utf-8 would help?

On Wed, Jul 20, 2011 at 10:28 PM, Tim McNamara <tim.mcnamara at okfn.org> wrote:
> How did you debug this/identify the problem? Would be good to know the
> original data & request made.
>
> Of your proposed causes, I would say it's likely to be 1 or 4. I expect 1 is
> the cause, as  encoding issues between UTF-8 characters and bytes can be
> tricky (http://bugs.python.org/issue11082).
> On 21 July 2011 08:13, Friedrich Lindenberg <friedrich.lindenberg at okfn.org>
> wrote:
>>
>> Hi all,
>>
>> I've just made this [1] bugfix related to uploading content as JSON to
>> the webstore via httplib.HTTPConnection. The problem manifests itself
>> in that the content-length header sent to the server is two bytes
>> short. I have no clue what problem this fixes and if it actually fixes
>> the problem for all cases or will come back to haunt us. I'd be very
>> grateful if the Python-gurus here could spend a few moments to help me
>> understand:
>>
>> - Is this an encoding bug?
>> - Is it related to JSON?
>> - Is it related to HTTP PUT?
>> - Could it be newlines?
>>
>> Thanks for any input.
>>
>> - Friedrich
>>
>> [1]
>> https://github.com/okfn/webstore-client/commit/2d7af09102f8ce4606fc69843aa03a2fbc33d000
>> --
>> Open Knowledge Foundation
>> Promoting Open Knowledge in a Digital Age
>> http://www.okfn.org/ - http://blog.okfn.org/
>>
>> http://twitter.com/pudo
>> http://pudo.org
>>
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
>
>



-- 
Open Knowledge Foundation
Promoting Open Knowledge in a Digital Age
http://www.okfn.org/ - http://blog.okfn.org/

http://twitter.com/pudo
http://pudo.org




More information about the ckan-dev mailing list