Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #63191

Re: "More About Unicode in Python 2 and 3"

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; '"this': 0.03; 'subject:Python': 0.06; '"""': 0.07; 'json': 0.07; 'arguments': 0.09; 'exception,': 0.09; 'lawrence': 0.09; 'resolved,': 0.09; 'valueerror:': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'jan': 0.12; '"got': 0.16; '3.3,': 0.16; 'codecs': 0.16; 'elsewhere,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'progressive': 0.16; 'subject:More': 0.16; 'subject:Unicode': 0.16; 'url:json': 0.16; 'url:pocoo': 0.16; 'urllib': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'bit': 0.19; 'passing': 0.19; '>>>': 0.22; 'import': 0.22; 'cc:addr:python.org': 0.22; "aren't": 0.24; 'bytes': 0.24; 'parse': 0.24; 'mon,': 0.24; "haven't": 0.24; 'looks': 0.24; 'cc:2**0': 0.24; 'handling': 0.26; 'switch': 0.26; 'this:': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; '"",': 0.31; 'fine,': 0.31; 'shoot': 0.31; 'subject:About': 0.31; 'file': 0.32; 'another': 0.32; 'text': 0.33; 'worked': 0.33; 'url:python': 0.33; '(most': 0.33; 'there,': 0.34; 'maybe': 0.34; 'could': 0.34; 'problem': 0.35; "can't": 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'messenger': 0.36; 'raising': 0.36; 'url:org': 0.36; 'should': 0.36; 'recent': 0.39; 'heard': 0.39; 'enough': 0.39; 'skip:u 10': 0.60; 'subject:"': 0.60; 'most': 0.60; 'url:5': 0.61; 'simple': 0.61; 'between': 0.67; 'removal': 0.74; 'lack': 0.78; 'improvement': 0.84; 'url:2014': 0.84; 'on?': 0.91; '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; bh=txAh1jhY1XgcGYTokGZ/lSlrPq6l8DQ4DD6oe3mROfw=; b=CeUAiAW0/mBOSBh0PmG1M363t0lE3X0rxJvSEQXP4P14zgaRNLtXBbXBiyfaBmscjD Yh9S2PsEE3+lacRT026r8kkEp/w9AyORwnJzWQq5b0Xpikk4bkIwFV0XUl5WjssqaGR3 f2T4AdURR69akjRZGlFneasFYiG3gR4Bu83Arh8zd3IusU9vYVYNj1OKwjslc4PfJhm7 1ZgMQBAZSTNlAhx4ZDv60EJ0zMchWMV9Q9tAw0jHA4BpdSCRXbOolpguAfPGcdyMDXyk ywZtw1DcZMaWF+FSrC3NSiMluRNX2g/ufrGbWns9yvYV9Nl3yWX9+bWISOx5AqWTvx/v kbHg==
MIME-Version 1.0
X-Received by 10.68.133.6 with SMTP id oy6mr41682012pbb.153.1388928890609; Sun, 05 Jan 2014 05:34:50 -0800 (PST)
In-Reply-To <lablra$1mc$2@ger.gmane.org>
References <lablra$1mc$2@ger.gmane.org>
Date Mon, 6 Jan 2014 00:34:50 +1100
Subject Re: "More About Unicode in Python 2 and 3"
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4944.1388928900.18130.python-list@python.org> (permalink)
Lines 45
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1388928900 news.xs4all.nl 2833 [2001:888:2000:d::a6]:49756
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:63191

Show key headers only | View raw


On Mon, Jan 6, 2014 at 12:14 AM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> http://lucumr.pocoo.org/2014/1/5/unicode-in-2-and-3/
>
> Please don't shoot the messenger :)

Most of that is tiresome reiterations of the same arguments ("It
worked fine, there were just a few problems" - which means that you
haven't thought through text vs bytes properly; the switch to Py3
highlights a problem that was already there, which means that Py3
showed up what was already a problem - sounds a bit like Romans 7 to
me), plus complaints that have been heard elsewhere, like the
encode/decode methods and the removal of codecs that aren't
str<->bytes. (Don't know if that one will ever be resolved, but it's
not enough to say that Python 3 "got it wrong". As we've seen from
3.3, there has been a progressive improvement in compatibility between
Py2 and Py3. Maybe 3.5 will recreate some of these things people are
moaning about the lack of, which would then prove that the Py3 model
isn't fundamentally flawed by their loss. Anyhow.)

But this bit looks odd:

"""
For instance passing a urllib request object to Flask's JSON parse
function breaks on Python 3 but works on Python 2 as a result of this:

>>> from urllib.request import urlopen
>>> r = urlopen('https://pypi.python.org/pypi/Flask/json')
>>> from flask import json
>>> json.load(r)
Traceback (most recent call last):
  File "decoder.py", line 368, in raw_decode
StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: No JSON object could be decoded
"""

Why is a StopIteration bubbling up? (I don't have Flask, so I can't
verify this.) Is it as simple as "this should be raising from None",
or is there something else going on?

ChrisA

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: "More About Unicode in Python 2 and 3" Chris Angelico <rosuav@gmail.com> - 2014-01-06 00:34 +1100
  Re: "More About Unicode in Python 2 and 3" Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-01-06 09:56 +1100
    Re: "More About Unicode in Python 2 and 3" Chris Angelico <rosuav@gmail.com> - 2014-01-06 11:04 +1100
    Re: "More About Unicode in Python 2 and 3" Ethan Furman <ethan@stoneleaf.us> - 2014-01-05 16:13 -0800

csiph-web