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.
@@ -40,7 +40,7 @@ def token(**params):
response, api_key = requestor.request(
'post', '/oauth/token', params, None)
- return response
+ return response.data
from #371:
Follow the reproduction steps, confirm the failure, apply the fix, and repeat the same steps to verify the behavior changes.
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).
- 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
- GitHub issue: #393
- Fix PR: https://github.com/stripe/stripe-python/pull/394
- First fixed release: 1.77.2
- Reproduced locally: No (not executed)
- Last verified: 2026-02-08
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.79
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.”
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
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 Message
-------------
customer.save(idempotency_key=ik)
credit_request_id = customer.last_response.request_id # Breaks! last_response is None
Minimal Reproduction
- 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
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.
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
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
| Version | Status |
|---|---|
| 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.