From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Max Arnold Newsgroups: gmane.emacs.help Subject: Re: python mode shell and unicode Date: Sun, 28 Mar 2010 20:08:22 +0700 Message-ID: <20100328130822.GA7535@bbone> References: <20100326153543.GA11085@bbone> <4BAE44D0.9090804@easy-emacs.de> <20100328024756.GA4890@bbone> <4BAF044E.7010304@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1269781745 19129 80.91.229.12 (28 Mar 2010 13:09:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 28 Mar 2010 13:09:05 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 28 15:09:01 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NvsEf-0006tt-Ay for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Mar 2010 15:09:01 +0200 Original-Received: from localhost ([127.0.0.1]:55784 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvsEe-0003Iu-Dr for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Mar 2010 09:09:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NvsEB-0003Hi-6r for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 09:08:31 -0400 Original-Received: from [140.186.70.92] (port=32935 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NvsEA-0003H3-3b for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 09:08:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NvsE7-0008DD-5M for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 09:08:29 -0400 Original-Received: from mail-fx0-f224.google.com ([209.85.220.224]:42031) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NvsE7-0008Cy-0R for help-gnu-emacs@gnu.org; Sun, 28 Mar 2010 09:08:27 -0400 Original-Received: by fxm24 with SMTP id 24so80108fxm.26 for ; Sun, 28 Mar 2010 06:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:mail-followup-to:references:mime-version:content-type :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=8a5DElmtqVnqsemtFnmc0vNS9cpIbCNDYpXFRtCCDOk=; b=GnPEYuqDsP5CY47wKtIf2OaS6Y9PdNpSc1kVp+xdeJo//y5Ah65xaRs7xcKbfDnqth N6rzCZBzZ2jSveIF/IY+FKpu+wsTMQd9lY1GB7ZJy8vIrjbbV5hRbV/JGBV1gCM6rh1d NZJJDEPecBh01ZEqHzlmSVjdGxbUC5+MB7wUs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; b=TaM4he9PGJq0Idn/9zTdciQY2DusfFOsIsQFmr9FIkXac8I1hcDEmLUjr9wKrxXG4f t/XjN0io8xiEiiYITGtIing6aV7OA0Jhu4Sy+rPln1wSVv13THhoT0/PiyZXJPM01cn2 dO9L6PbeUMkjYVIraqTMxqoq8GIgblbSWPsro= Original-Received: by 10.223.19.91 with SMTP id z27mr1583522faa.104.1269781705949; Sun, 28 Mar 2010 06:08:25 -0700 (PDT) Original-Received: from bbone ([212.75.220.126]) by mx.google.com with ESMTPS id 16sm2179754fxm.4.2010.03.28.06.08.24 (version=SSLv3 cipher=RC4-MD5); Sun, 28 Mar 2010 06:08:25 -0700 (PDT) Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <4BAF044E.7010304@easy-emacs.de> User-Agent: Mutt/1.5.20 (2009-06-14) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:72509 Archived-At: On Sun, Mar 28, 2010 at 09:25:02AM +0200, Andreas Röhler wrote: > Hmm, see inside `python-send-region' > > ;; Fixme: Write a `coding' header to the temp file if the region is > ;; non-ASCII. > > Maybe that indicates the cause? I think this is unrelated to the issue because my python code contains no unicode characters; they are received from parsed web page and then printed to stdout. The problem is with python process spawned by Emacs - its stdout encoding is not specified (sys.stdout.encoding is None). Maybe this is a python feature: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=415968 But then I do not understand why manually invoked pyton-shell handles unicode characters just fine... > You could try `py-execute-file' from python-mode.el Sorry, didn't mentioned that I use python.el shipped with emacs. How to disable built-in one and enable python-mode.el? How to invoke py-execute-file from M-x prompt? BTW, print u'\xA9' is a nice test for this issue. Cheers, Max