This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ngie
Recipients jcea, ngie
Date 2011-11-29.20:04:42
SpamBayes Score 0.0003662484
Marked as misclassified No
Message-id <1322597085.53.0.375939873101.issue13500@psf.upfronthosting.co.za>
In-reply-to
Content
Sure -- the repro steps are pretty easy:

1. Startup an interactive python shell.
2. Enter in the following code:

{{{
import cmd
class Foo(cmd.Cmd):
    def do_bar(self, arg):
        """bar"""

Foo().cmdloop()
}}}

3. You will be greeted with the standard `(Cmd)' prompt.
4. Press enter. Nothing will be printed out (it will continue on to the next line).
5. Enter in Control-D, you will be greeted with `Unknown syntax: EOF' error message from cmd.Cmd.default(..).
6. Press enter multiple times.

Expected output:

- Since a do_EOF handler isn't installed in 5., I expect to see the `Unknown syntax: EOF' error print out on the console. I don't want to delve into whether or not this should or shouldn't be printed out in this ticket.
- Every time I press <enter> I should be greeted with the prompt, and not the `Unknown syntax: EOF` error.

Actual output:
- I see `Unknown syntax: EOF' error, and every time I press <enter> it displays the error beforementioned error.

Example:

{{{
>>> import cmd
>>> class Foo(cmd.Cmd):
...     def do_bar(self, arg):
...         """bar"""
... 
>>> Foo().cmdloop()
(Cmd) 
(Cmd) 
bar   help  
(Cmd) help bar
bar
(Cmd) ^D*** Unknown syntax: EOF
(Cmd) 
*** Unknown syntax: EOF
(Cmd) 
*** Unknown syntax: EOF
}}}
History
Date User Action Args
2011-11-29 20:04:45ngiesetrecipients: + ngie, jcea
2011-11-29 20:04:45ngiesetmessageid: <1322597085.53.0.375939873101.issue13500@psf.upfronthosting.co.za>
2011-11-29 20:04:42ngielinkissue13500 messages
2011-11-29 20:04:42ngiecreate