Jump to solution
Verify

The Fix

pip install stripe==1.77.2

Based on closed stripe/stripe-python issue #393 · PR/commit linked

Production note: This usually shows up under retries/timeouts. Treat it as a side-effect risk until you can verify behavior with a canary + real traffic.

Jump to Verify Open PR/Commit
@@ -40,7 +40,7 @@ def token(**params): response, api_key = requestor.request( 'post', '/oauth/token', params, None) - return response + return response.data
repro
from #371:
verify
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.
fix.md
Option A — Upgrade to fixed release\npip install stripe==1.77.2\nWhen NOT to use: Do not use this fix if the last_response attribute is not required for your application logic.\n\n

Why This Fix Works in Production

  • Trigger: customer.save(idempotency_key=ik)
  • Mechanism: The last_response attribute was not set correctly during the save operation
  • Why the fix works: Fixes the issue where StripeObject.last_response is None on save() calls by ensuring that the last_response attribute is properly set during the save operation. (first fixed release: 1.77.2).
Production impact:
  • If left unfixed, this can cause silent data inconsistencies that propagate (bad cache entries, incorrect downstream decisions).

Why This Breaks in Prod

  • The last_response attribute was not set correctly during the save operation
  • Production symptom (often without a traceback): customer.save(idempotency_key=ik)

Proof / Evidence

Discussion

High-signal excerpts from the issue thread (symptoms, repros, edge-cases).

“Thanks @jleclanche. I was able to reproduce this easily, will try to push a fix soon.”
@ob-stripe · 2018-02-08 · source

Failure Signature (Search String)

  • customer.save(idempotency_key=ik)
  • credit_request_id = customer.last_response.request_id # Breaks! last_response is None
Copy-friendly signature
signature.txt
Failure Signature ----------------- customer.save(idempotency_key=ik) credit_request_id = customer.last_response.request_id # Breaks! last_response is None

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- customer.save(idempotency_key=ik) credit_request_id = customer.last_response.request_id # Breaks! last_response is None

Minimal Reproduction

  1. from #371:

What Broke

Customers experienced issues where last_response was None after save() calls.

Why It Broke

The last_response attribute was not set correctly during the save operation

Fix Options (Details)

Option A — Upgrade to fixed release Safe default (recommended)

pip install stripe==1.77.2

When NOT to use: Do not use this fix if the last_response attribute is not required for your application logic.

Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.

Fix reference: https://github.com/stripe/stripe-python/pull/394

First fixed release: 1.77.2

Last verified: 2026-02-08. Validate in your environment.

Get updates

We publish verified fixes weekly. No spam.

Subscribe

When NOT to Use This Fix

  • Do not use this fix if the last_response attribute is not required for your application logic.

Verify Fix

verify
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.

Did This Fix Work in Your Case?

Quick signal helps us prioritize which fixes to verify and improve.

Prevention

  • Capture the exact failing error string in logs and tests so you can reproduce via a minimal script.
  • Pin production dependencies and upgrade only with a reproducible test that hits the failing path.

Version Compatibility Table

VersionStatus
1.77.2 Fixed

Related Issues

No related fixes found.

Sources

We don’t republish the full GitHub discussion text. Use the links above for context.