This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author isandler
Recipients
Date 2006-04-21.02:39:42
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=971153

I do see your point (In fact it was me who submitted the
patch #896011 which separated pdb namespace from the
program's -- and thus broke imports from __main__ ;-))..

I do want to bring a couple of points:

1. I don't think it matters whether a program can
intentionally interfere with pdb...Even when pdb's namespace
is separated, it's easy for the program to  interfere with
debugger.. (Or delete your home directory for that matter)

2. Importing from __main_ may not be common in the std lib,
but that's simply because stdlib doesn't contain that many
executable hence there are very few places where there is
__main__ to import from. 

google search for "from __main__ import" results in about 1M
hits.


3. Just for the record, profile module does not separate its
 namespace from programs's either...

So, basically, it boils down to this: what's worse breaking
imports from __main__ or risking accidental interference
between pdb and the program (e.g if your program redefines a
help symbol)...

As a middle ground it might be a good idea to expand the
patch to reduce pdb's dependency on module global symbols
and thus reducing the risk of interference.

What do you think?


History
Date User Action Args
2007-08-23 15:45:39adminlinkissue1429539 messages
2007-08-23 15:45:39admincreate