Visitar URL original
`SystemError` caused by `_interpreters.create()` with invalid unicode argument · Issue #126223 · python/cpython · GitHub
Skip to content

SystemError caused by _interpreters.create() with invalid unicode argument #126223

Closed

Description

@devdanzin

Bug report

Bug description:

It's possible to make a debug build of Python abort by passing an invalid Unicode argument to _interpreters.create(), resulting in SystemError: <built-in function create> returned a result with an exception set.

$ ./python -c "import _interpreters; _interpreters.create('\udc80')"
Fatal Python error: _Py_CheckFunctionResult: a function returned a result with an exception set
Python runtime state: initialized
UnicodeEncodeError: 'utf-8' codec can't encode character '\udc80' in position 0: surrogates not allowed

The above exception was the direct cause of the following exception:

SystemError: <built-in function create> returned a result with an exception set

Current thread 0x00007f0234dca740 (most recent call first):
  File "<string>", line 1 in <module>
Aborted

Found using fusil by @vstinner.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux, Windows

Linked PRs

Activity

  1. ZeroIntensity commented on Oct 31, 2024

    @ZeroIntensity
    Member

    Confirmed, this is a pretty simple fix. I'll submit a patch.

  2. added a commit that references this issue on Oct 31, 2024
  3. added a commit that references this issue on Oct 31, 2024
  4. added
    3.13only security fixes
    3.14bugs and security fixes
    on Oct 31, 2024
  5. added a commit that references this issue on Oct 31, 2024
  6. picnixz commented on Oct 31, 2024

    @picnixz
    Member

    Closing since completed and backported. Thank you all!

  7. added a commit that references this issue on Dec 8, 2024
  8. added a commit that references this issue on Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions