Skip to content

AttributeError: 'NoneType' object has no attribute 'request' #122

Closed
@ghost

Description

Tried running the following in REPL but it gave an error.

>>> import adafruit_requests
>>> r = adafruit_requests.get('https://www.google.com')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_requests.py", line 809, in get
AttributeError: 'NoneType' object has no attribute 'request'

I looked at the adafruit_requests.py file and it appears that in line 735 _default_session is defined as None. Thus, when _default_session.request("GET", url, **kw) is called in line 809, this error arises. Am I wrong to use this library as I would with basic Python?

Metadata

Metadata

Assignees

No one assigned

    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