]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixing #125452 - shlex.shlex hangs when it encounters a string with an
authorMoshe Zadka <moshez@math.huji.ac.il>
Sat, 31 Mar 2001 08:42:37 +0000 (08:42 +0000)
committerMoshe Zadka <moshez@math.huji.ac.il>
Sat, 31 Mar 2001 08:42:37 +0000 (08:42 +0000)
unmatched quote

Lib/shlex.py

index fd7535a3c630efa3c1cfb76083b7ca895a6bdbb0..c4cfc7846844f61147fa9189aadd34c1a17c42b0 100644 (file)
@@ -123,6 +123,11 @@ class shlex:
                 if nextchar == self.state:
                     self.state = ' '
                     break
+                elif not nextchar:      # end of file
+                    if self.debug >= 2:
+                        print "shlex: I see EOF in quotes state"
+                    # XXX what error should be raised here?
+                    raise ValueError, "No closing quotation"
             elif self.state == 'a':
                 if not nextchar:
                     self.state = None;  # end of file