stripe/stripe-python

Errpr: argument of type 'NoneType' is not iterable when calling Invoice.lines.

gogosofta opened this issue · 2 comments

Describe the bug

The auto_paging_iter() function call for Invoice.lines returns TypeError: argument of type 'NoneType' is not iterable

To Reproduce

  1. Retrieve an invoice object:
    invoice = stripe.Invoice.retrieve("in_1LSfVlJWbpnZzq9uoMMwSKAn")
  2. Fetch iterator data:
    next(invoice.lines.auto_paging_iter())

Expected behavior

Until version 3.5.0, the output was correct and as expected:

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

As of 4.0.0, the function call throws the error described above.

Code snippets

No response

OS

AWS Linux 5.4.0-1080

Language version

Python 3.8

Library version

stripe-python v4.0.1

API version

2018-09-24

Additional context

No response

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 in v3.5.0, so there is a regression here.

Let me look into a fix and report back!

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