Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 31165 invoked from network); 3 Feb 2011 12:59:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Feb 2011 12:59:38 -0000 Received: (qmail 62344 invoked by uid 500); 3 Feb 2011 12:59:36 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 62006 invoked by uid 500); 3 Feb 2011 12:59:33 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 61998 invoked by uid 99); 3 Feb 2011 12:59:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 12:59:32 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of heshiming@gmail.com designates 209.85.214.180 as permitted sender) Received: from [209.85.214.180] (HELO mail-iw0-f180.google.com) (209.85.214.180) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 03 Feb 2011 12:59:25 +0000 Received: by iwn37 with SMTP id 37so1076699iwn.11 for ; Thu, 03 Feb 2011 04:59:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=FjZx1NKLs+XA+lYEbyPF12qggaecL4dgHkH17IvNDDk=; b=RMZm29k844lqMCMq7betVQDekW9ijnWXDKdPZyGh2F41x5Sav2RVBPNoJvyfm6e2iD M/nI0OLXx4jgYdc+vVTXM93ffmMTquNRxLOI73Cmi+kdbbj2CaG6KWgLGizXUpSyFsv9 T3Z9TR6I0nH+S0Lyv2fUkZEgsTCpkVRV8kM0I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LrJaQeoeuE2TG3Xr2BvEblF35GAtNOFG4/6nDFaVvjx12DMp5jkpTBL/qMXXNcbv8U BK9GdjZVXaAPGxSS31jI+xnBj6X8RhoMOTu9PGRzPmDbKXxlx128nArUtNQtX74fRmf7 35MftNx/HpVO7d1OfmW+DbxLvsnhR1ld9gujs= MIME-Version: 1.0 Received: by 10.42.165.74 with SMTP id j10mr12602988icy.130.1296737945325; Thu, 03 Feb 2011 04:59:05 -0800 (PST) Received: by 10.42.146.136 with HTTP; Thu, 3 Feb 2011 04:59:05 -0800 (PST) Date: Thu, 3 Feb 2011 20:59:05 +0800 Message-ID: Subject: 400, ('bad_request', 'Attachment name is not UTF-8 encoded') From: He Shiming To: user@couchdb.apache.org Content-Type: text/plain; charset=ISO-8859-1 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