Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!hq-usenetpeers.eweka.nl!hq-usenetpeers.eweka.nl!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '16,': 0.03; 'encoding': 0.05; 'subject:Python': 0.06; 'utf-8': 0.07; 'interpreted': 0.09; 'output,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'bug': 0.12; '2.7': 0.14; 'curly': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'say.': 0.16; 'subject:install': 0.16; 'subject:versions': 0.16; 'throw': 0.16; 'two,': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'print': 0.22; 'error': 0.23; 'bytes': 0.24; 'unicode': 0.24; 'looks': 0.24; '(or': 0.24; 'question': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'character': 0.29; 'statement': 0.30; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; '(unless': 0.31; 'breaking': 0.31; 'subject:what': 0.31; 'stuff': 0.32; 'running': 0.33; 'subject:the': 0.34; "can't": 0.35; 'anywhere': 0.35; 'skip:u 20': 0.35; 'something': 0.35; 'convert': 0.35; 'but': 0.35; 'received:google.com': 0.35; '2.6': 0.36; 'believed': 0.36; 'possible': 0.36; 'subject:?': 0.36; 'being': 0.38; 'pm,': 0.38; 'rather': 0.38; 'does': 0.39; 'major': 0.40; 'easy': 0.60; 'most': 0.60; 'matter': 0.61; "you're": 0.61; "you'll": 0.62; 'between': 0.67; 'break.': 0.84; 'difference.': 0.84; 'to:none': 0.92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=WOP1x344yoF3AUQSgRnibIcZvI8vACGMcfQRHZ7alHo=; b=xm9aEt27v8Yq37dC2Qud3NP5orFnVUpcCe58dW4+d6XKKcAw+eAm/yxLMI7rNRVHMe S/JoBV9xKgIjLtkHW2GbO+FYk9j9pybLlP78t6hWvdHeaCDnwp+Kjny1JmqVunCsJvpl Z7D9+e4ZIHk709IpPa40YlgDbrkrhZ1bh2cACnlySl5uU1tTpGbJrSaeejNI2ZS/Uy24 pUxsso92SvGXcRLC1BtQWAzeMYefOxSTJQGRsgBc3r1bQmQ0Z80dOy/70KBwEPA+nmKN JWsrwvJMTaVbUieQnssqob9Viv0v/5vrQcFeT7Zl634pLFhlo+3Oxa0QoCe7mBtKQedw z2Gw== MIME-Version: 1.0 X-Received: by 10.107.19.203 with SMTP id 72mr2123684iot.27.1413471573036; Thu, 16 Oct 2014 07:59:33 -0700 (PDT) In-Reply-To: <219536496.81828.1413462689661.JavaMail.yahoo@jws10745.mail.gq1.yahoo.com> References: <219536496.81828.1413462689661.JavaMail.yahoo@jws10745.mail.gq1.yahoo.com> Date: Fri, 17 Oct 2014 01:59:32 +1100 Subject: Re: what is the easiest way to install multiple Python versions? From: Chris Angelico Cc: Python Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 25 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1413471581 news.xs4all.nl 2903 [2001:888:2000:d::a6]:49442 X-Complaints-To: abuse@xs4all.nl X-Received-Body-CRC: 3167781531 X-Received-Bytes: 5068 Xref: csiph.com comp.lang.python:79215 On Thu, Oct 16, 2014 at 11:31 PM, Albert-Jan Roskam wrote= : > Most things were indeed easy to solve. But this one surprised me. With Py= thon 2.6, I need to outcomment the 'lambda' line. The error is what I get i= n Python 2.6. It does not matter if I do u"\n".join(het_logboek[i:]). I don= 't use latin-1 anywhere in my program. I need to convert unicode to bytes i= n Python 2.6, or else it chokes in the smart quote. > Hmm, that looks like a configuration difference between the two, rather than a major breaking difference. It'll depend on the console settings; if you're running 2.6 from cron, but 2.7 from the console (or the other way around), you'll see stuff like this break. It's also possible that a bug was discovered, of course, but what exactly the bug is, I can't say. The error you're seeing is perfectly correct: you have Unicode character U+2018 (a curly quote) in your stream, and the print statement is trying to send that to a Latin-1 output, and that's not going to work. The question is, why is your console believed to be set to Latin-1? And if encoding UTF-8 works, then there's something very VERY wrong. (Unless by "works" you just mean "doesn't throw an error", and the UTF-8 bytes are being interpreted as Latin-1 bytes.) ChrisA