[Python-Dev] [Python-checkins] cpython (3.3): - Issue #16514: Fix regression causing a traceback when sys.path[0] is None

Brett Cannon brett at python.org
Wed Nov 21 17:33:40 CET 2012


On Tue, Nov 20, 2012 at 6:41 PM, Barry Warsaw <barry at python.org> wrote:

> On Nov 20, 2012, at 05:35 PM, Terry Reedy wrote:
>
> >On 11/20/2012 3:35 PM, barry.warsaw wrote:
> >
> >>           for entry in path:
> >> +            if not isinstance(entry, (str, bytes)):
> >> +                continue
> >
> >Given that a non-(str,bytes) entry could indicate a programming error,
> should
> >a warning be emitted before continuing?
>
> That's not what happens in Python 3.2.


Fine, but warnings are off by default and this is simply wrong behaviour to
do. We should not paper over it just because import.c did.


>  In fact, this bug report was triggered
> by someone who was already inserting None to sys.path[0].  It is silently
> ignored in Python 3.2, but tracebacked in 3.3.


But why were they doing that? What did they hope to get out of it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20121121/9c3a1dc1/attachment.html>


More information about the Python-Dev mailing list