)]}'
{
  "commit": "ac8b5b6890006ee7254ea878866cb486ff835ecb",
  "tree": "eb0f2f9cb5f4c7f48648017702cf313394170ea1",
  "parents": [
    "b121dc434748772272514311fe315e009fdfe6e5"
  ],
  "author": {
    "name": "Gregory P. Smith",
    "email": "68491+gpshead@users.noreply.github.com",
    "time": "Tue Feb 10 13:08:33 2026"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Feb 10 13:08:33 2026"
  },
  "message": "gh-143650: Fix importlib race condition on import failure (GH-143651)\n\nFix a race condition where a thread could receive a partially-initialized\nmodule when another thread\u0027s import fails. The race occurs when:\n\n1. Thread 1 starts importing, adds module to sys.modules\n2. Thread 2 sees the module in sys.modules via the fast path\n3. Thread 1\u0027s import fails, removes module from sys.modules\n4. Thread 2 returns a stale module reference not in sys.modules\n\nThe fix adds verification after the \"skip lock\" optimization in both Python\nand C code paths to check if the module is still in sys.modules. If the\nmodule was removed (due to import failure), we retry the import so the\ncaller receives the actual exception from the import failure rather than\na stale module reference.\n\nCo-Authored-By: Claude Opus 4.5 \u003cnoreply@anthropic.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "07d938b18fe7275d142d3697ccc5a64c0a0c09d1",
      "old_mode": 33188,
      "old_path": "Lib/importlib/_bootstrap.py",
      "new_id": "cfcebb7309803c7158d700f80b64d5c02a8b226e",
      "new_mode": 33188,
      "new_path": "Lib/importlib/_bootstrap.py"
    },
    {
      "type": "modify",
      "old_id": "f78dc399720c8674cb44cfabe1b46232ff0eb8a2",
      "old_mode": 33188,
      "old_path": "Lib/test/test_importlib/test_threaded_import.py",
      "new_id": "8b793ebf29bcae4fe88a71287850619dff267e82",
      "new_mode": 33188,
      "new_path": "Lib/test/test_importlib/test_threaded_import.py"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "7bee70a828acfeefa518daffd789b8679368e1a6",
      "new_mode": 33188,
      "new_path": "Misc/NEWS.d/next/Core_and_Builtins/2026-01-10-10-58-36.gh-issue-143650.k8mR4x.rst"
    },
    {
      "type": "modify",
      "old_id": "e7f803d84f1367070ecaa016ef930ac5e09e8d70",
      "old_mode": 33188,
      "old_path": "Python/import.c",
      "new_id": "c9e892c96b03394e56a3c66821066386c1b6f461",
      "new_mode": 33188,
      "new_path": "Python/import.c"
    }
  ]
}
