acoustic-carpenter-78188
05/11/2026, 4:14 PMapply() derives the deployment version by piping the user's envs and
image cache through cloudpickle.dumps. If anything in the user's
task or environment is unpicklable (e.g. a captured
`sys.stdin`/`stdout` tty handle, an open file, a thread, or a lock),
cloudpickle raises `PicklingError`/`TypeError` and the raw stack ends
up in Sentry.
This change wraps the version-hash computation and translates those
pickle failures into a click.ClickException that names the most
common cause and points the user at the version= escape hatch. The
new ClickException short-circuits the Sentry filter added in #1039 so
we stop logging user-side closure mistakes as SDK crashes.
Closes
• FLYTE-SDK-21 -- PicklingError: Cannot pickle files that map to tty objects from cloudpickle._file_reduce
fixes https://github.com/flyteorg/flyte-sdk/issues/FLYTE-SDK-21
Test plan
• New unit test in tests/flyte/test_deploy.py covers the unpicklable-envs path.
• make fmt clean.
🤖 Generated with Claude Code
flyteorg/flyte-sdkacoustic-carpenter-78188
05/11/2026, 8:06 PM