Skip to content

ValueError: Bad Args PS1 object – when using VSCode Python extension v2024.0.0 or newer #1041

@interDist

Description

@interDist

Within the terminal panel of VSCode with Python extension enabled:

>>> python -m pip show bpython curtsies
Name: bpython
Version: 0.21
Summary: Fancy Interface to the Python Interpreter
Requires: curtsies, cwcwidth, greenlet, pygments, pyxdg, requests
Required-by: 
---
Name: curtsies
Version: 0.4.0
Summary: Curses-like terminal wrapper, with colored strings!
Requires: blessed, cwcwidth
Required-by: bpython

>>> bpython
bpython version 0.21 on top of Python 3.12.3 /root/.venvs/p312/bin/python3

Traceback (most recent call last):
  File "/root/.venvs/p312/bin/bpython", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/root/.venvs/p312/lib/python3.12/site-packages/bpython/curtsies.py", line 201, in main
    exit_value = repl.mainloop(True, paste)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.venvs/p312/lib/python3.12/site-packages/bpython/curtsies.py", line 113, in mainloop
    self.process_event_and_paint(None)
  File "/root/.venvs/p312/lib/python3.12/site-packages/bpython/curtsies.py", line 95, in process_event_and_paint
    array, cursor_pos = self.paint()
                        ^^^^^^^^^^^^
  File "/root/.venvs/p312/lib/python3.12/site-packages/bpython/curtsiesfrontend/repl.py", line 1468, in paint
    min_height, width, self.current_cursor_line
                       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.venvs/p312/lib/python3.12/site-packages/bpython/curtsiesfrontend/repl.py", line 1374, in current_cursor_line
    return self.current_cursor_line_without_suggestion + suggest(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.venvs/p312/lib/python3.12/site-packages/bpython/curtsiesfrontend/repl.py", line 1363, in current_cursor_line_without_suggestion
    "" if self.coderunner.running else self.display_line_with_prompt
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.venvs/p312/lib/python3.12/site-packages/bpython/curtsiesfrontend/repl.py", line 1352, in display_line_with_prompt
    prompt(self.ps1) if self.done else more(self.ps2)
    ^^^^^^^^^^^^^^^^
  File "/root/.venvs/p312/lib/python3.12/site-packages/curtsies/formatstring.py", line 883, in fmtstr
    raise ValueError(
ValueError: Bad Args: <__main__.PS1 object at 0x76bb09ea1550> (of type <class '__main__.PS1'>), (), {'fg': 36, 'bold': False}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions