question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatibility with prompt_toolkit v3

See original GitHub issue

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'

This is because ipdb is not compatible with prompt_toolkit v3.0.0 (released 24th Nov) .

Can you either make ipdb compatible, or specify an upper bound for prompt_toolkit in the ipdb requirements please?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gotchacommented, Nov 28, 2019

As I sometimes merge code done by others I do not always remember it all, this gave me a chance to remember that prompt_toolkit is an IPython dependency 😉

0reactions
hachreakcommented, Nov 28, 2019

With prompt_toolkit==2.0.10 looks working again! 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incompatibility with prompt_toolkit v3.0.0 · Issue #11975 · ipython ...
I noticed the following error today: def pt_init(self): def get_prompt_tokens(): return [(Token.Prompt, self.prompt)] if self.
Read more >
1835511 – python-aiocmd: incompatible with prompt-toolkit 3
Description of problem: The versions of aiocmd and prompt-toolkit shipped in rawhide (f33) are not compatible. Version-Release number of ...
Read more >
Asking for input (prompts) - Python Prompt Toolkit 3.0
Prompt -toolkit supports both Emacs and Vi key bindings, similar to Readline. The prompt() function will use Emacs bindings by default. This is...
Read more >
Rasa 1.9.3 has requirement prompt-toolkit<3.0,>=2.0, but you ...
... I'm getting this error “rasa 1.9.3 has requirement prompt-toolkit<3.0,>=2.0, but you'll have prompt-toolkit 3.0.5 which is incompatible.
Read more >
Incompatible Version of prompt-toolkit - M220P - MongoDB
I add the MongoClient.ipynb to the trust list and select a cell to execute it. The kernel starts but there is this yet...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found