Python Unexpected keyword argument' in constructor call

Viewed 982

Hi and thanks in advance for your help. I am not a Python expert but an accomplished programmer in other languages.

I'm getting the error on "is_server_running"

Client

from ibw.client import IBClient

REGULAR_USERNAME = 'MY_ACCOUNT_USERNAME'
REGULAR_ACCOUNT = 'MY_ACCOUNT_NUMBER'

# Create a new session of the IB Web API.
ib_client = IBClient(username=REGULAR_USERNAME,
                     account=REGULAR_ACCOUNT,
                     client_gateway_path=None,
                     is_server_running=True)

class IBClient():

    def __init__(self, username: str, account: str, client_gateway_path: str = None, is_server_running: 
                 bool = True) -> None

        self.account = account
        self.username = username
        self.client_gateway_path = client_gateway_path
        self.client_portal_client = ClientPortal()

        self.api_version = 'v1/'
        self._operating_system = sys.platform
        self.session_state_path: pathlib.Path = 
                                 pathlib.Path(__file__).parent.joinpath('server_session.json').resolve()
        self.authenticated = False
        self._is_server_running = is_server_running

        # Define URL Components
        ib_gateway_host = r"https://localhost"
        ib_gateway_port = r"5000"
        self.ib_gateway_path = ib_gateway_host + ":" + ib_gateway_port
        self.backup_gateway_path = r"https://cdcdyn.interactivebrokers.com/portal.proxy"
        self.login_gateway_path = self.ib_gateway_path + "/sso/Login?forwardTo=22&RL=1&ip2loc=on"

[more code]

Again thanks in advance for your help

Bob
0 Answers
Related