AttributeError: __enter__

  • When trying to create my client (which works fine directly with the generic OpenDXL client), I get the following:

    Traceback (most recent call last):

    /opendxl-irflow-client/sample/basic/", line 25, in <module>

    with IRFlowApiClient(config) as client:

    AttributeError: __enter__

    My understanding is that if I'm inheiriting the base dxl bootstrap client, this should work (since __enter__ should be available)

    The two files involved are:…er/irflowclient/


    Any ideas what would cause this?

  • The issue is that you are attempting to use your client (not the DXL client) with the Python with keyword.

    Your code should resemble the following example (from the TIE client):

    Basic Get Reputation Example

    Your client (IRFlowApiClient) should be created in the same manner as the TieClient shown above.

    Hope this helps.