Skip to content

enable free threading in watchdog_fsevents.c #1140

@davidism

Description

@davidism

I'd like to run the Werkzeug test suite on Python 3.14t. However, the fsevents extension is not marked for free threading, so it enables the GIL when imported. I'm not sure what will be involved in actually supporting free threading for the watchdog extension, but here's what we did in MarkupSafe to indicate support: https://github.com/pallets/markupsafe/blob/b2e4d9c7687be25695fffbe93a37622302b24fb1/src/markupsafe/_speedups.c#L178-L194

static PyModuleDef_Slot module_slots[] = {
#ifdef Py_mod_multiple_interpreters  // Python 3.12+
	{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
#endif
#ifdef Py_mod_gil  // Python 3.13+
	{Py_mod_gil, Py_MOD_GIL_NOT_USED},
#endif
	{0, NULL}  /* Sentinel */
};


static struct PyModuleDef module_definition = {
	.m_base = PyModuleDef_HEAD_INIT,
	.m_name = "markupsafe._speedups",
	.m_size = 0,
	.m_methods = module_methods,
	.m_slots = module_slots,
};

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions