Jump to solution
Verify

The Fix

pip install stripe==14.4.0a2

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

Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.

Jump to Verify Open PR/Commit
@@ -174,8 +174,13 @@ def convert_to_stripe_object( ) - if hasattr(obj, "object") and ( - (obj.object == "list") or (obj.object == "search_result") + # We only need to update _retrieve_params when special params were
repro.py
Out[1]: <InvoiceLineItem line_item id=sli_196a32JWbpnZzq9u8b781cd6 at 0x7f51a4bf5450> JSON: { "amount": 0, "amount_excluding_tax": 0, "currency": "usd", .... }
verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
fix.md
Option A — Upgrade to fixed release\npip install stripe==14.4.0a2\nWhen NOT to use: Do not use this fix if the application relies on the previous behavior of returning None.\n\n

Why This Fix Works in Production

  • Trigger: The auto_paging_iter() function call for Invoice.lines returns **TypeError: argument of type 'NoneType' is not iterable**
  • Mechanism: The auto_paging_iter function failed due to a NoneType being returned instead of an iterable
  • Why the fix works: Fixes the issue where auto_paging_iter failed on nested list objects, which caused a TypeError when retrieving invoice lines. (first fixed release: 14.4.0a2).
Production impact:
  • If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.

Why This Breaks in Prod

  • Shows up under Python 3.8 in real deployments (not just unit tests).
  • The auto_paging_iter function failed due to a NoneType being returned instead of an iterable
  • Production symptom (often without a traceback): The auto_paging_iter() function call for Invoice.lines returns **TypeError: argument of type 'NoneType' is not iterable**

Proof / Evidence

Discussion

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

“Thanks again for the report @gogosofta and sorry about the trouble. This has been fixed and released in 4.0.2: https://github.com/stripe/stripe-python/releases/tag/v4.0.2”
@dcr-stripe · 2022-08-03 · confirmation · source
“Hi @gogosofta , thank you for the report and sorry you're having problems! I can reproduce with v4.0.1 and can also confirm it doesn't occur…”
@dcr-stripe · 2022-08-03 · source

Failure Signature (Search String)

  • The auto_paging_iter() function call for Invoice.lines returns **TypeError: argument of type 'NoneType' is not iterable**
  • As of 4.0.0, the function call throws the error described above.
Copy-friendly signature
signature.txt
Failure Signature ----------------- The auto_paging_iter() function call for Invoice.lines returns **TypeError: argument of type 'NoneType' is not iterable** As of 4.0.0, the function call throws the error described above.

Error Message

Signature-only (no traceback captured)
error.txt
Error Message ------------- The auto_paging_iter() function call for Invoice.lines returns **TypeError: argument of type 'NoneType' is not iterable** As of 4.0.0, the function call throws the error described above.

Minimal Reproduction

repro.py
Out[1]: <InvoiceLineItem line_item id=sli_196a32JWbpnZzq9u8b781cd6 at 0x7f51a4bf5450> JSON: { "amount": 0, "amount_excluding_tax": 0, "currency": "usd", .... }

Environment

  • Python: 3.8

What Broke

The application encountered a TypeError when trying to iterate over invoice lines, causing functionality to break.

Why It Broke

The auto_paging_iter function failed due to a NoneType being returned instead of an iterable

Fix Options (Details)

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

pip install stripe==14.4.0a2

When NOT to use: Do not use this fix if the application relies on the previous behavior of returning None.

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/855

First fixed release: 14.4.0a2

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 application relies on the previous behavior of returning None.

Verify Fix

verify
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.

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
14.4.0a2 Fixed

Related Issues

No related fixes found.

Sources

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