[Python-checkins] cpython (2.7): #3573: idle now doesn't hungs if launched as: idle -e <directory>

andrew.svetlov python-checkins at python.org
Wed Mar 21 12:36:08 CET 2012


http://hg.python.org/cpython/rev/a9be863e5734
changeset:   75848:a9be863e5734
branch:      2.7
parent:      75840:4e5ddde76dbe
user:        Andrew Svetlov <andrew.svetlov at gmail.com>
date:        Wed Mar 21 13:35:08 2012 +0200
summary:
  #3573: idle now doesn't hungs if launched as: idle -e <directory>

Patch by Guilherme Polo.

files:
  Lib/idlelib/NEWS.txt   |  7 +++++++
  Lib/idlelib/PyShell.py |  6 ++++--
  Misc/NEWS              |  3 +++
  3 files changed, 14 insertions(+), 2 deletions(-)


diff --git a/Lib/idlelib/NEWS.txt b/Lib/idlelib/NEWS.txt
--- a/Lib/idlelib/NEWS.txt
+++ b/Lib/idlelib/NEWS.txt
@@ -1,3 +1,10 @@
+What's New in IDLE 2.7.3?
+=======================
+
+- Issue #3573: IDLE hangs when passing invalid command line args
+  (directory(ies) instead of file(s)).
+
+
 What's New in IDLE 2.7.2?
 =======================
 
diff --git a/Lib/idlelib/PyShell.py b/Lib/idlelib/PyShell.py
--- a/Lib/idlelib/PyShell.py
+++ b/Lib/idlelib/PyShell.py
@@ -1412,8 +1412,10 @@
 
     if enable_edit:
         if not (cmd or script):
-            for filename in args:
-                flist.open(filename)
+            for filename in args[:]:
+                if flist.open(filename) is None:
+                    # filename is a directory actually, disconsider it
+                    args.remove(filename)
             if not args:
                 flist.new()
     if enable_shell:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -27,6 +27,9 @@
 Library
 -------
 
+- Issue #3573: IDLE hangs when passing invalid command line args
+  (directory(ies) instead of file(s)) (Patch by Guilherme Polo)
+
 - Issue #13694: asynchronous connect in asyncore.dispatcher does not set addr
   attribute.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list