diff -r b6759568b812 Lib/test/test_cmd_line.py --- a/Lib/test/test_cmd_line.py Thu Jun 23 21:26:48 2011 -0400 +++ b/Lib/test/test_cmd_line.py Fri Jun 24 17:40:23 2011 +0200 @@ -259,6 +259,13 @@ "print(repr(input()))", b"'abc'") + def test_unmached_quote(self): + # Issue #10206: python program starting with unmatched quote + # spews spaces to stdout + rc, out, err = assert_python_failure('-c', "'") + self.assert_('SyntaxError' in err.decode('ascii', 'ignore')) + self.assertEqual(b'', out) + def test_main(): test.support.run_unittest(CmdLineTest)