#1726198: replace while 1: fp.readline() with file iteration.
diff --git a/Lib/urlparse.py b/Lib/urlparse.py
index ada6142..631a5a1 100644
--- a/Lib/urlparse.py
+++ b/Lib/urlparse.py
@@ -306,9 +306,7 @@
         except ImportError:
             from StringIO import StringIO
         fp = StringIO(test_input)
-    while 1:
-        line = fp.readline()
-        if not line: break
+    for line in fp:
         words = line.split()
         if not words:
             continue