开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

TypeError: TestApp.error() takes 4 positional arguments but 5 were given


Joel Gross
 

I have been running TWS API with Python for years without many issues. Suddenly my code that worked yesterday is no longer working. Any file I run, I get an error like this:

Traceback (most recent call last):
? File "c:\Users\joel\joelvscode\ib\ibapp\ibapi\value_stock_picker\11_get_tws_fundamental_data.py", line 296, in <module>
? ? main()
? File "c:\Users\joel\joelvscode\ib\ibapp\ibapi\value_stock_picker\11_get_tws_fundamental_data.py", line 287, in main
? ? app.run()
? File "c:\users\joel\joelvscode\ib\ibapp\ibapi\launchLoop.py", line 409, in run
? ? self.decoder.interpret(fields)
? File "c:\Users\joel\joelvscode\.venv\lib\site-packages\ibapi\decoder.py", line 1377, in interpret
? ? self.interpretWithSignature(fields, handleInfo)
? File "c:\Users\joel\joelvscode\.venv\lib\site-packages\ibapi\decoder.py", line 1358, in interpretWithSignature
? ? method(*args)
? File "c:\users\joel\joelvscode\ib\ibapp\ibapi\launchLoop.py", line 515, in nextValidId
? ? self.start()
? File "c:\Users\joel\joelvscode\ib\ibapp\ibapi\value_stock_picker\11_get_tws_fundamental_data.py", line 137, in start
? ? self.runWithoutSchedule()
? File "c:\users\joel\joelvscode\ib\ibapp\ibapi\launchLoop.py", line 466, in runWithoutSchedule
? ? self.decoder.interpret(fields)
? File "c:\Users\joel\joelvscode\.venv\lib\site-packages\ibapi\decoder.py", line 1379, in interpret
? ? handleInfo.processMeth(self, iter(fields))
? File "c:\Users\joel\joelvscode\.venv\lib\site-packages\ibapi\decoder.py", line 1273, in processErrorMsg
? ? self.wrapper.error(reqId, errorCode, errorString, advancedOrderRejectJson)
TypeError: TestApp.error() takes 4 positional arguments but 5 were given

I am running Windows 10, TWS Latest, API Latest. About the time this error started, I had to switch from Visual Studio Code to Visual Studio Code Insiders. Python files run regularly under VS Code Insiders just fine.

What could cause this to happen??

Join [email protected] to automatically receive all group messages.