incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From faust 1111 <faust...@gmail.com>
Subject Re: 400, ('bad_request', 'Attachment name is not UTF-8 encoded')
Date Thu, 03 Feb 2011 14:37:37 GMT
You talk about this ticket
https://issues.apache.org/jira/browse/COUCHDB-760?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

2011/2/3 He Shiming <heshiming@gmail.com>

> Hi,
>
> I'm accessing CouchDB 1.0.1 on localhost from python-couchdb. I
> discovered this problem while trying to use Chinese characters to name
> attachments of the document.
>
> So I'm calling couchdb.Database.put_attachment with some Chinese
> characters as name: u'\u7eff\u53f6\u60c5-2753303'. Attachment saving
> will cause an HTTP 400 error, with message 'Attachment name is not
> UTF-8 encoded'.
>
> I'm not sure if I should encode the string to utf-8 myself. So I tried
> to encode the above string by unicode(filename).encode('utf-8'). It
> becomes: '\xe7\xbb\xbf\xe5\x8f\xb6\xe6\x83\x85-2753303'. I still got
> the same error.
>
> Sometimes it's not even HTTP 400 error. It's "error: [Errno 104]
> Connection reset by peer", which means the connection got cut off
> unexpectedly. But other functions of CouchDB remain fine after this
> error. It's happening to non-alphanumeric character attachment names
> in particular.
>
> Is this a bug or should I avoid using such names as attachment name?
>
> --
> Best regards,
> He Shiming
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message