BitMEX / sample-market-maker

Sample BitMEX Market Making Bot
Apache License 2.0
1.7k stars 757 forks source link

__on_close() takes exactly 2 arguments (4 given) #33

Closed JayDeng2837 closed 6 years ago

JayDeng2837 commented 6 years ago

my "on_close" function actually looks like this:

def __on_close(self, ws):
    self.logger.warning('Websocket Closed.')
    self.exit()

not sure why i am getting this error "__on_close() takes exactly 2 arguments (4 given)"

has anyone seen similar error?

STRML commented 6 years ago

Might be an update in the underlying websocket lib that passes more arguments. I'll take a look. Regardless, the app was about to close anyway.

STRML commented 6 years ago

Hmm, their docs still read that as a single argument (two if a member of a class): see https://github.com/websocket-client/websocket-client. Make sure your packages are up to date.

cowthinker commented 6 years ago

I have a similar error: TypeError: exit() takes 1 positional argument but 3 were given

I installed the package from github with the link above and restarted the bot, nothing changed. websocket-client (0.44.0)

I'm using Python 3.6.2

On Thu, Dec 7, 2017 at 3:28 PM, Samuel Reed notifications@github.com wrote:

Hmm, their docs still read that as a single argument (two if a member of a class): see https://github.com/websocket-client/websocket-client. Make sure your packages are up to date.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/BitMEX/sample-market-maker/issues/33#issuecomment-350084829, or mute the thread https://github.com/notifications/unsubscribe-auth/AMxCAaxq1QiQWiqIMn48IWqE7H2375-xks5s-Ep1gaJpZM4Q46CY .

JayDeng2837 commented 6 years ago

I was using websocket-client(0.44.0).
I ran the test_client below and it returned no error on my system(py2.7, ubuntu 16.04). https://github.com/websocket-client/websocket-client/blob/master/examples/echoapp_client.py

this leads me to believe that the problem might be related to the close_frame that BITMEX sent while close.

ryanfox commented 6 years ago

Couple things: