Skip to content

Requests in CircuitPython Library Bundle 5.x-mpy-20200918 seems incompatible with CircuitPython 5.3.1 #32

Closed
@anecdata

Description

@anecdata

Requests work here:
Adafruit Feather M4 Express with samd51j19
CircuitPython 5.3.1 on 2020-07-13
CircuitPython Library Bundle 5.x-mpy-20200917

But not here:
Adafruit Feather M4 Express with samd51j19
CircuitPython 5.3.1 on 2020-07-13
CircuitPython Library Bundle 5.x-mpy-20200918

Socket missing recv_into. Using more memory to be compatible
Traceback (most recent call last):
  File "code.py", line 1446, in <module>
  File "code.py", line 527, in http_get
  File "code.py", line 521, in http_get
  File "adafruit_requests.py", line 583, in get
  File "adafruit_requests.py", line 494, in request
  File "adafruit_requests.py", line 100, in __init__
  File "adafruit_requests.py", line 128, in _readto
AttributeError: 'bytearray' object has no attribute 'find'

Seems to be this 6.0.0-alpha change:
Add .find, .rfind, .index and .rindex to bytearray for CPython-compatible builds.

Is this a case where the 5.x and 6.x bundles should diverge, should devices running 5.3.1 max out with the 20200917 bundle, or is it worth making the library backwards-compatible?

The offending line 521 is:
response = requests.get(url, data=None, json=None, headers=custom_hdrs, stream=False, timeout=timeout)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions