Terry J. Reedy added the comment:

At one time, there would not have been any point.  
https://docs.python.org/3/library/__main__.html#module-__main__ contains this 
sentence "For a package, the same effect can be achieved by including a 
__main__.py module, the contents of which will be executed when the module is 
run with -m.", which was new for 3.0.  The .../2/... doc does not as this is a 
new-in-3.0 feature.  Thus, I am surprised by
C:\Users\Terry>py -m idlelib
C:\Programs\Python27\python.exe: No module named idlelib.__main__; 'idlelib' is 
a package and cannot be directly executed
AFAIK, 2.7 should not even be looking for .__main__.

After I copied idlelib/__main__.py to my 2.7 install and repeated the command 
line, Idle tried to start, but imports of submodules failed, subprocess 
connection failed, and the editor was opened for blank numbered files like 
'C:/programs/python27/50343'.  After that, normal ways of starting Idle also 
failed similarly.  Reinstalling 2.7 (with remnamts of the old idlelib left) did 
not fix things.  The only way I found to restore Idle was to delete 2.7 
idlelib/ completely and run Programs and Features (win 7) repair, which 
restores a fresh copy that works again.  I tried again with same results, so I 
am done experimenting.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23546>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to