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 Kimball Leavitt
Recipients Catherine.Devlin, Kimball Leavitt, aldwinaldwin, boompig, ngie, rhettinger
Date 2019-09-27.15:48:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1569599323.25.0.252335404409.issue13214@roundup.psfhosted.org>
In-reply-to
Content
I know that many people do something like:

def do_EOF(self, arg):
    return True

to exit the program when you press Ctrl+d. Others might prefer something like ngie https://bugs.python.org/issue13214#msg145856:

def do_EOF(self, arg):
    raise EOFError

The issue that I have is if the command you enter is 'EOF' (or 'EOF --some --arg'), you end up calling your do_EOF function. I think this unintended side effect could be avoided if the check for EOFError was removed and the exception was just raised. (see https://github.com/python/cpython/blob/master/Lib/cmd.py#L127).
History
Date User Action Args
2019-09-27 15:48:43Kimball Leavittsetrecipients: + Kimball Leavitt, rhettinger, ngie, Catherine.Devlin, boompig, aldwinaldwin
2019-09-27 15:48:43Kimball Leavittsetmessageid: <1569599323.25.0.252335404409.issue13214@roundup.psfhosted.org>
2019-09-27 15:48:43Kimball Leavittlinkissue13214 messages
2019-09-27 15:48:43Kimball Leavittcreate