Skip to content

journald: TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object #13

@juju4

Description

@juju4

I'm trying to implement a journald option
master...juju4:spython:devel-journald

build ok (tested on Fedora 41/python 3.13.2)
usage nok (TypeError, see readme.md)

$ ./spython
Python 3.13.2 (main, Feb  4 2025, 00:00:00) [GCC 14.2.1 20250110 (Red Hat 14.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("hello")
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/lib64/python3.13/_pyrepl/__main__.py", line 6, in <module>
    __pyrepl_interactive_console()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib64/python3.13/_pyrepl/main.py", line 59, in interactive_console
    run_multiline_interactive_console(console)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/usr/lib64/python3.13/_pyrepl/simple_interact.py", line 143, in run_multiline_interactive_console
    statement = multiline_input(more_lines, ps1, ps2)
  File "/usr/lib64/python3.13/_pyrepl/readline.py", line 389, in multiline_input
    return reader.readline()
           ~~~~~~~~~~~~~~~^^
  File "/usr/lib64/python3.13/_pyrepl/reader.py", line 806, in readline
    self.restore()
    ~~~~~~~~~~~~^^
  File "/usr/lib64/python3.13/_pyrepl/reader.py", line 659, in restore
    self.console.restore()
    ~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib64/python3.13/_pyrepl/unix_console.py", line 380, in restore
    signal.signal(signal.SIGWINCH, self.old_sigwinch)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/signal.py", line 58, in signal
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object

Same with TERM screen-256color and xterm, or with PYTHONUSEREPL=0

Setting "TERM=dumb " makes it work.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions