python / cpython

The Python programming language
https://www.python.org
Other
63.12k stars 30.22k forks source link

Cmd.complete does not handle cmd=None #79451

Open 1f7c169c-a6ad-45ae-b614-0d40d962c776 opened 5 years ago

1f7c169c-a6ad-45ae-b614-0d40d962c776 commented 5 years ago
BPO 35270
Nosy @blueyed, @iritkatriel
PRs
  • python/cpython#10588
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = None closed_at = None created_at = labels = ['3.8', 'type-bug', 'library'] title = 'Cmd.complete does not handle cmd=None' updated_at = user = 'https://github.com/blueyed' ``` bugs.python.org fields: ```python activity = actor = 'iritkatriel' assignee = 'none' closed = False closed_date = None closer = None components = ['Library (Lib)'] creation = creator = 'blueyed' dependencies = [] files = [] hgrepos = [] issue_num = 35270 keywords = ['patch'] message_count = 2.0 messages = ['330035', '401285'] nosy_count = 2.0 nosy_names = ['blueyed', 'iritkatriel'] pr_nums = ['10588'] priority = 'normal' resolution = None stage = 'patch review' status = 'open' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue35270' versions = ['Python 3.8'] ```

    1f7c169c-a6ad-45ae-b614-0d40d962c776 commented 5 years ago

    When parseline returns None for cmd (like pdb++ might cause it when changing a cmd "disable" to "!disable"), the following will cause a TypeError:

    compfunc = getattr(self, 'complete_' + cmd)

    "None" should be also forwarded to "completedefault", just like cmd="".

    iritkatriel commented 3 years ago

    Changing type since crash is typically used for a segfault rather than an exception.