From: Moshe Zadka Date: Sat, 31 Mar 2001 08:42:37 +0000 (+0000) Subject: Fixing #125452 - shlex.shlex hangs when it encounters a string with an X-Git-Tag: v2.0.1c1~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a60cde3d7b6115bd9a8a871c356a47cbcb44e934;p=thirdparty%2FPython%2Fcpython.git Fixing #125452 - shlex.shlex hangs when it encounters a string with an unmatched quote --- diff --git a/Lib/shlex.py b/Lib/shlex.py index fd7535a3c630..c4cfc7846844 100644 --- a/Lib/shlex.py +++ b/Lib/shlex.py @@ -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