[Python-Dev] If you shadow a module in the standard library that IDLE depends on, bad things happen

Nathaniel Smith njs at pobox.com
Thu Oct 29 15:21:12 EDT 2015


On Oct 29, 2015 11:45 AM, "Donald Stufft" <donald at stufft.io> wrote:
>
> Every test runner that includes a =E2=80=94pdb flag that will automatical=
> ly invoke pdb at the point of failure. If pdb++ didn=E2=80=99t force the =
> shadowing of stdlib, then every single test runner would need an option l=
> ike =E2=80=94pdb++ instead of =E2=80=94pdb (or it would need to unconditi=
> onally prefer pdb++ over pdb if you had =E2=80=94pdb). But what if I
don=E2=
> =80=99t like pdb++ and I want to use some other pdb replacement=3F Possib=
> ly one I=E2=80=99m writing myself=3F Either I can convince every test run=
> ner to support every pdb replacement or I need some sort of central regis=
> try where I can insert my pdb as a replacement to the =E2=80=9Creal=E2=80=
> =9D pdb. The sys.path and import system is one such registry that already=
>  exists and is (my opinion) the logical choice.

This strikes me as an argument for adding some sort of explicit plugin
support to pdb, or defining a standard interface that test tools could use
to query for installed debuggers. (Presumably via some entry point that
alternative debugger packages would export?) In any case it's orthogonal to
the issue of accidental shadowing. It seems unlikely that at this late date
we'll be swapping the order of sys.path so site-packages comes before the
stdlib, and I doubt there are a lot of people who are using pdb++ via the
mechanism of making sure that it's always present in their working
directory...

-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20151029/ca28eb3b/attachment-0001.html>


More information about the Python-Dev mailing list