10000 Unhandled 'ValueError: not enough values to unpack' when inspecting MagicMock.method_calls · Issue #610 · prompt-toolkit/ptpython · GitHub
[go: up one dir, main page]

Skip to content

Unhandled 'ValueError: not enough values to unpack' when inspecting MagicMock.method_calls #610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rpdelaney opened this issue Apr 14, 2025 · 0 comments

Comments

@rpdelaney
Copy link
Contributor
>>> m.method_calls
[call.get()]
>>> m.method_calls[0]
Traceback (most recent call last):
  File "/home/ryan/src/me/reed/.venv/bin/ptpython", line 10, in <module>
    sys.exit(run())
             ~~~^^
  File "/home/ryan/src/me/reed/.venv/lib/python3.13/site-packages/ptpython/entry_points/run_ptpython.py", line 217, in run
    embed_result = embed(  # type: ignore
        vi_mode=a.vi,
    ...<6 lines>...
        return_asyncio_coroutine=a.asyncio,
    )
  File "/home/ryan/src/me/reed/.venv/lib/python3.13/site-packages/ptpython/repl.py", line 575, in embed
    repl.run()
    ~~~~~~~~^^
  File "/home/ryan/src/me/reed/.venv/lib/python3.13/site-packages/ptpython/repl.py", line 174, in run
    self.run_and_show_expression(text)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/ryan/src/me/reed/.venv/lib/python3.13/site-packages/ptpython/repl.py", line 114, in run_and_show_expression
    self._show_result(result)
    ~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/home/ryan/src/me/reed/.venv/lib/python3.13/site-packages/ptpython/repl.py", line 141, in _show_result
    self._get_output_printer().display_result(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        result=result,
        ^^^^^^^^^^^^^^
    ...<3 lines>...
        paginate=self.enable_pager,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/ryan/src/me/reed/.venv/lib/python3.13/site-packages/ptpython/printer.py", line 84, in display_result
    self._display_result(result, paginate=paginate)
    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ryan/src/me/reed/.venv/lib/python3.13/site-packages/ptpython/printer.py", line 118, in _display_result
    for line in lines:
                ^^^^^
  File "/home/ryan/src/me/reed/.venv/lib/python3.13/site-packages/ptpython/printer.py", line 222, in _insert_out_prompt_and_split_lines
    for i, line in enumerate(split_lines(result)):
                   ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
  File "/home/ryan/src/me/reed/.venv/lib/python3.13/site-packages/prompt_toolkit/formatted_text/utils.py", line 88, in split_lines
    for style, string, *mouse_handler in fragments:
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: not enough values to unpack (expected at least 2, got 0)
$ ptpython --version
3.0.29
4574
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0