Skip to content

ValueError: Bad Args PS1 object – on python 3.12 #1041

@interDist

Description

@interDist

On Python 3.10:

>>> python3 -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.10.7 /root/.venvs/p310/bin/python3

After updating my environment to Python 3.12:

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

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions