From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#24117: 25.1; url-http-create-request: Multibyte text in HTTP request Date: Sun, 31 Jul 2016 17:31:33 +0300 Message-ID: <83d1ltq3p6.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1469975556 32522 80.91.229.8 (31 Jul 2016 14:32:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 31 Jul 2016 14:32:36 +0000 (UTC) Cc: 24117@debbugs.gnu.org To: Sho Takemori Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 31 16:32:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bTrmq-0008NM-Hk for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Jul 2016 16:32:16 +0200 Original-Received: from localhost ([::1]:39779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTrmm-0000Wb-FM for geb-bug-gnu-emacs@m.gmane.org; Sun, 31 Jul 2016 10:32:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTrmh-0000WU-2k for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2016 10:32:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTrmc-00025S-Sf for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2016 10:32:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:54975) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTrmc-00025O-PP for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2016 10:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bTrmc-0002K9-Im for bug-gnu-emacs@gnu.org; Sun, 31 Jul 2016 10:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Jul 2016 14:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24117 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24117-submit@debbugs.gnu.org id=B24117.14699755068909 (code B ref 24117); Sun, 31 Jul 2016 14:32:02 +0000 Original-Received: (at 24117) by debbugs.gnu.org; 31 Jul 2016 14:31:46 +0000 Original-Received: from localhost ([127.0.0.1]:52272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bTrmL-0002Jd-TN for submit@debbugs.gnu.org; Sun, 31 Jul 2016 10:31:46 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bTrmK-0002JO-L0 for 24117@debbugs.gnu.org; Sun, 31 Jul 2016 10:31:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTrmC-00024u-8J for 24117@debbugs.gnu.org; Sun, 31 Jul 2016 10:31:39 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTrmC-00024q-58; Sun, 31 Jul 2016 10:31:36 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3434 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bTrmA-0007ni-9t; Sun, 31 Jul 2016 10:31:34 -0400 In-reply-to: (message from Sho Takemori on Sun, 31 Jul 2016 17:26:37 +0900) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121741 Archived-At: > From: Sho Takemori > Date: Sun, 31 Jul 2016 17:26:37 +0900 > > I got an error "error in process sentinel: url-http-create-request: Multibyte text in HTTP request" when I visited a > Python file which contains a multibyte character with `anaconda-eldoc-mode' turned on. That file name should have been encoded by the time it is passed to url-http.el, so the problem should not have happened, because encoded strings are unibyte strings. > At first, I thought this was a bug of anaconda-mode. So I opened an issue in github > (https://github.com/proofit404/anaconda-mode/issues/189). > > I guess `(= (string-bytes request) (length request))` in `url-http-create-request' should be `(= (string-bytes > url-http-data) (length url-http-data))`, because `(= (string-bytes request) (length request))` may be `nil' even if > `(= (string-bytes url-http-data) (length url-http-data))` is `t'. I don't think I agree in general: all the strings that are used by url-http-create-request should be unibyte strings. if they all are unibyte strings, then I think the situation you describe should not happen. However, you didn't provide enough details to analyze the situation, so perhaps I'm missing something. Could you please show all the details, specifically, what were the values of the various variables used by url-http-create-request to generate the request? For each value that is a string, please also tell whether it's a unibyte or a multibyte string. Thanks.