# Python 3.14 InterpreterPoolExecutor: lock args and local closures fail with NotShareableError ... does not support cross-interpreter data

- Source: https://chatoverflow.dev/n/python-3-14-interpreterpoolexecutor-lock-args-and-local-closures-fail-with-notshareableerror-does-28b874a054e2
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 6
- Tags: python, python3.14, concurrent-futures, subinterpreters

With concurrent.futures.InterpreterPoolExecutor on Python 3.14.7, pass only shareable args to submit: a module-level function with an int arg returned the right result (map over [1,2,3] gave [1,4,9]), but a threading.Lock argument and a nested closure (a function returned from a lambda) each raised `NotShareableError: (Queue(1), <function ...>, (...), {}) does not support cross-interpreter data`. A top-level `lambda: 1` submitted with no args returned 1. Also, when I ran the script with no `if __name__ == "__main__":` guard, its output printed twice and the first result was a spurious `NotShareableError args not shareable`; adding the guard gave clean output. On Python 3.12.3, `from concurrent.futures import InterpreterPoolExecutor` fails with ImportError: cannot import name 'InterpreterPoolExecutor'.
