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 ronaldoussoren
Recipients Rosuav, barry, ncoghlan, ronaldoussoren
Date 2017-06-06.19:54:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496778891.58.0.0977863372267.issue29929@psf.upfronthosting.co.za>
In-reply-to
Content
If only someone had access to the time machine keys to fix this 20 year ago :-(. Anything beyond that last option (recognising that the script tries to import itself under another name) is bound to run into odd issues or backward compatibility concerns.

Just recognising a reimport of __main__ should avoid a lot of confusion though, from what I've seen in discussions most cases of unintentional shadowing of the stdlib is caused by folks naming a exploratory script the same as a stdlib module (e.g. naming a script "socket.py" when experimenting with sockets).

W.r.t. "from . import ..." and scripts: installing using entry points isn't a problem, but installing using plain distutils still is as is the even more low-tech option of just copying files to the right location (maybe using a Makefile).  But that issue is moot now that Guido has stated he doesn't like the idea.
History
Date User Action Args
2017-06-06 19:54:51ronaldoussorensetrecipients: + ronaldoussoren, barry, ncoghlan, Rosuav
2017-06-06 19:54:51ronaldoussorensetmessageid: <1496778891.58.0.0977863372267.issue29929@psf.upfronthosting.co.za>
2017-06-06 19:54:51ronaldoussorenlinkissue29929 messages
2017-06-06 19:54:51ronaldoussorencreate