Skip to content

Incompatibility with prompt_toolkit v3.0.0 #11975

Closed

Description

@jakul

I noticed the following error today:

    def pt_init(self):
        def get_prompt_tokens():
            return [(Token.Prompt, self.prompt)]

        if self._ptcomp is None:
            compl = IPCompleter(shell=self.shell,
                                        namespace={},
                                        global_namespace={},
                                        parent=self.shell,
                                       )
            self._ptcomp = IPythonPTCompleter(compl)

        kb = KeyBindings()
        supports_suspend = Condition(lambda: hasattr(signal, 'SIGTSTP'))
        kb.add('c-z', filter=supports_suspend)(suspend_to_bg)

        if self.shell.display_completions == 'readlinelike':
            kb.add('tab', filter=(has_focus(DEFAULT_BUFFER)
                                  & ~has_selection
                                  & vi_insert_mode | emacs_insert_mode
                                  & ~cursor_in_leading_ws
                              ))(display_completions_like_readline)

        self.pt_app = PromptSession(
                            message=(lambda: PygmentsTokens(get_prompt_tokens())),
                            editing_mode=getattr(EditingMode, self.shell.editing_mode.upper()),
                            key_bindings=kb,
                            history=self.shell.debugger_history,
                            completer=self._ptcomp,
                            enable_history_search=True,
                            mouse_support=self.shell.mouse_support,
                            complete_style=self.shell.pt_complete_style,
                            style=self.shell.style,
                            inputhook=self.shell.inputhook,
>                           color_depth=self.shell.color_depth,
        )
E       TypeError: __init__() got an unexpected keyword argument 'inputhook'

PromptSession in prompt_toolkit v3 does not have an inputhook parameter - https://github.com/prompt-toolkit/python-prompt-toolkit/blob/4cbbf8b9db1cb11caa1d72f4200c5cbc48bfd384/prompt_toolkit/shortcuts/prompt.py#L340-L383

Activity

  1. added this to the 7.10 milestone on Nov 28, 2019
  2. iuliachiriac commented on Nov 29, 2019

    @iuliachiriac

    There's also a discussion (and some solutions) on this issue here: #11962

  3. added a commit that references this issue on Nov 30, 2019
    f52ca01
  4. Carreau commented on Nov 30, 2019

    @Carreau
    Member

    See #11979. I'll try to do a 7.10.1 on monday.

  5. techtonik commented on Dec 1, 2019

    @techtonik
    Contributor

    @Carreau but 7.10 is not out, why 7.10.1?

  6. techtonik commented on Dec 1, 2019

    @techtonik
    Contributor
  7. modified the milestones: 7.10, 7.10.1 on Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions