Skip to content

Commit 89a7bed

Browse files
committed
Use worker mode for auto context on Python < 3.14
Auto mode now uses worker mode (not subinterpreters) on Python 3.12/3.13 to avoid crashes from C extensions like _decimal that have global state bugs in subinterpreters. On Python 3.14+ where these bugs are fixed, auto mode uses subinterpreters. Users can still explicitly use subinterp mode if needed, but must be aware of the C extension limitations on older Python versions.
1 parent ba5f4fe commit 89a7bed

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/py_context.erl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,12 @@ apply_registered_paths(Ref) ->
521521
end.
522522

523523
%% @private
524+
%% Auto mode uses subinterpreters only on Python 3.14+ where C extension
525+
%% global state bugs (e.g., _decimal) are fixed. On Python 3.12/3.13,
526+
%% use worker mode to avoid crashes from C extensions like _decimal.
527+
%% Users can still explicitly use subinterp mode if needed.
524528
create_context(auto) ->
525-
case py_nif:subinterp_supported() of
529+
case py_nif:owngil_supported() of
526530
true -> create_context(subinterp);
527531
false -> create_context(worker)
528532
end;

0 commit comments

Comments
 (0)