Mercurial > cpython-lru_cache-weakref
diff Lib/idlelib/PyShell.py @ 20306:1ca228e21a98 legacy-trunk
merged port binding error message patch
| author | Steven M. Gava <elguavas@python.net> |
|---|---|
| date | Sun, 07 Oct 2001 11:44:49 +0000 |
| parents | 8aa63aea7269 |
| children | 8957341f98f8 |
line wrap: on
line diff
--- a/Lib/idlelib/PyShell.py Sun Oct 07 11:26:48 2001 +0000 +++ b/Lib/idlelib/PyShell.py Sun Oct 07 11:44:49 2001 +0000 @@ -730,6 +730,18 @@ class main: def __init__(self, noshell=1): + + global flist, root + root = Tk(className="Idle") + fixwordbreaks(root) + root.withdraw() + flist = PyShellFileList(root) + + dbg=OnDemandOutputWindow(flist) + dbg.set_title('IDLE Debugging Messages') + sys.stdout = PseudoFile(dbg,['stdout']) + sys.stderr = PseudoFile(dbg,['stderr']) + try: self.server = protocol.Server(connection_hook = self.address_ok) protocol.publish( 'IDLE', self.connect ) @@ -749,9 +761,27 @@ except protocol.connectionLost: pass - # xxx Should scream via Tk() - print "Something already has our socket, but it won't open a window for me!" - print "Unable to proceed." + #maybe the following should be handled by a tkmessagebox for + #users who don't start idle from a console?? + print """\ +IDLE cannot run. + +IDLE needs to use a specific TCP/IP port (7454) in order to execute and +debug programs. IDLE is unable to bind to this port, and so cannot +start. Here are some possible causes of this problem: + + 1. TCP/IP networking is not installed or not working on this computer + 2. Another program is running that uses this port + 3. Another copy of IDLE stopped responding but is still bound to the port + 4. Personal firewall software is preventing IDLE from using this port + +IDLE makes and accepts connections only with this computer, and does not +communicate over the internet in any way. It's use of port 7454 should not +be a security risk on a single-user machine. +""" + dbg.owin.gotoline(1) + dbg.owin.remove_selection() + root.mainloop() # wait for user to read message def idle(self): spawn.kill_zombies() @@ -828,12 +858,6 @@ if not dir in sys.path: sys.path.insert(0, dir) - global flist, root - root = Tk(className="Idle") - fixwordbreaks(root) - root.withdraw() - flist = PyShellFileList(root) - if edit: for filename in args: flist.open(filename) @@ -845,11 +869,6 @@ else: sys.argv = args or [""] - #dbg=OnDemandOutputWindow(flist) - #dbg.set_title('Internal IDLE Problem') - #sys.stdout = PseudoFile(dbg,['stdout']) - #sys.stderr = PseudoFile(dbg,['stderr']) - if noshell: flist.pyshell = None else:
