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


Groups > comp.lang.python > #82574

Re: Portable code: __import__ demands different string types between 2 and 3

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.021
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'subject:code': 0.07; 'versions,': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:string': 0.09; 'subtle': 0.09; 'python': 0.11; 'bug': 0.12; 'finney': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:between': 0.16; 'essential': 0.16; 'wrote:': 0.18; 'header:User-Agent:1': 0.23; 'error': 0.23; 'fixed.': 0.24; 'unicode': 0.24; 'right.': 0.26; 'gets': 0.27; 'header:X-Complaints-To:1': 0.27; 'fixed': 0.29; 'url:bugs': 0.29; "i'm": 0.30; '(maybe': 0.31; 'writes:': 0.31; 'worked': 0.33; 'url:python': 0.33; 'but': 0.35; 'url:org': 0.36; 'should': 0.36; 'ben': 0.38; 'improving': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'previous': 0.38; 'little': 0.38; 'obtain': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'around.': 0.60; 'course.': 0.60; 'eventually': 0.60; 'hope': 0.61; "you're": 0.61; "you'll": 0.62; 'skip:\xe2 10': 0.65; 'temporary': 0.65; 'ethan': 0.84; 'furman': 0.84; 'increasingly': 0.84; 'liberty': 0.84; 'received:125': 0.84; 'safety,': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Ben Finney <ben+python@benfinney.id.au>
Subject Re: Portable code: __import__ demands different string types between 2 and 3
Date Tue, 16 Dec 2014 13:53:21 +1100
References <85wq5tpe0g.fsf@benfinney.id.au> <548F18FC.5040408@stoneleaf.us> <85iohcpe9n.fsf@benfinney.id.au> <548F8F9A.9040708@stoneleaf.us>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host jigong.madmonks.org
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
X-Public-Key-ID 0xAC128405
X-Public-Key-Fingerprint 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405
X-Public-Key-URL http://www.benfinney.id.au/contact/bfinney-pubkey.asc
X-Post-From Ben Finney <bignose+hates-spam@benfinney.id.au>
Cancel-Lock sha1:YHTKUWSdXlJNrhYiIfemnn130rk=
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.16994.1418698437.18130.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1418698437 news.xs4all.nl 2971 [2001:888:2000:d::a6]:39254
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:82574

Show key headers only | View raw


Ethan Furman <ethan@stoneleaf.us> writes:

> On 12/15/2014 05:36 PM, Ben Finney wrote:
> > I'm increasingly of the opinion this is a subtle bug in ‘__import__’
> > that should be fixed instead of worked around.

And other people agree: <URL:https://bugs.python.org/issue21720>.

> Of course. But you'll still need to work around it for previous
> versions, unless you can say you only support 2.7.10+ (maybe 2.7.9+ if
> it gets fixed quick enough).

If I can eventually drop the kludge by dropping support for Python <2.7
at some future point (instead of waiting until I can drop Python <3),
that would still be an improvement.

> Functions that should accept str but barf on unicode have a tendency
> to get fixed.

I hope you're right. The bug report currently focusses on improving the
error message only.

-- 
 \          “They who can give up essential liberty to obtain a little |
  `\            temporary safety, deserve neither liberty nor safety.” |
_o__)                                   —Benjamin Franklin, 1775-02-17 |
Ben Finney

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


Thread

Re: Portable code: __import__ demands different string types between 2 and 3 Ben Finney <ben+python@benfinney.id.au> - 2014-12-16 13:53 +1100

csiph-web