SpotlightKid / mrequests

An HTTP client library (not only) for MicroPython with an API similar to requests
MIT License
49 stars 10 forks source link

NoneType Error on self.read() #6

Closed macalencar closed 1 year ago

macalencar commented 1 year ago

When I get a response without "Content-Length" specified on header the lib shows this:

File "./src/mrequests.py", line 161, in read TypeError: unsupported types for lt: 'int', 'NoneType'

I had to change the line 232 from self._cached = self.read(size=None) to self._cached = self.read()

Now it works!

https://github.com/SpotlightKid/mrequests/blob/4ba5cc62c5609360c18eb147605680ca66f4dfea/mrequests.py#L232

SpotlightKid commented 1 year ago

You don't seem to be using the latest version of the code. Please re-test with the current version in the repo.

SpotlightKid commented 1 year ago

Closing this due to no further feedback.

Feel free to re-open if you can provide additional information.