[New-bugs-announce] [issue32989] IDLE: Incorrect signature in call from editor to pyparse.find_good_parse_start

Cheryl Sabella report at bugs.python.org
Fri Mar 2 19:44:36 EST 2018


New submission from Cheryl Sabella <chekat2 at gmail.com>:

>From msg312726 on issue32880.

The call to find_good_parse_start:

    bod = y.find_good_parse_start(self.context_use_ps1, 
                         self._build_char_in_string_func(startatindex))

sends 3 parameters.  And in pyparse.find_good_parse_start(), the signature allows 3.  However, the signature is:

    def find_good_parse_start(self, is_char_in_string=None,
                              _synchre=_synchre):


This means that the `False` value in `self.use_context_ps1` is the first value instead of the function, so pyparse is always executing:

    if not is_char_in_string:
        # no clue -- make the caller pass everything
        return None


Here's the commit that changed the signature:
https://github.com/python/cpython/commit/b17544551fc8dfd1304d5679c6e444cad4d34d97

----------
assignee: terry.reedy
components: IDLE
messages: 313170
nosy: csabella, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE: Incorrect signature in call from editor to pyparse.find_good_parse_start
type: enhancement
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32989>
_______________________________________


More information about the New-bugs-announce mailing list