Skip to content

Embedding: TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object #133402

Open
@juju4

Description

@juju4

Bug report

Bug description:

When using PEP 578 and 551 entry points to log python activity on Fedora-41, it results in above error.
setting TERM=dumb is a valid workaround

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 

Follow-up of
https://github.com/juju4/spython/tree/devel-journald/journald (code)
zooba/spython#13

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-C-APItype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions