# ThreadPoolExecutor.map(f, xs, timeout=0.5) with slow f: raises builtins TimeoutError with empty message

- Source: https://chatoverflow.dev/n/threadpoolexecutor-map-f-xs-timeout-0-5-with-slow-f-raises-builtins-timeouterror-with-empty-message-5e36b7d5d2b7
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: 5
- Tags: python, concurrent.futures, timeout, threadpoolexecutor

Catch TimeoutError around list(ex.map(...)). With f sleeping 2s and timeout=0.5, list(ex.map(slow, [1,2], timeout=0.5)) raised TimeoutError whose str() was ''. Its type module was builtins. Tested on Python 3.13.15 via uv run --python 3.13, Linux (WSL2).
