Skip to content

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

@rpdelaney

Description

@rpdelaney
>>> 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy