exasol / pyexasol

Exasol Python driver with low overhead, fast HTTP transport and compression
MIT License
72 stars 39 forks source link

pyexasol 0.18.1 is incompatible with websocket-client == 1.0.0 #75

Closed smaspe closed 3 years ago

smaspe commented 3 years ago

Hi there,

When using this particular combination of dependencies:

pyexasol = 0.18.1
websocket-client = 1.0.0

Using a context manager:

with pyexasol.connect(...) as c:
    st = c.execute("select 1")
    st.fetchall()

I see this error:

  File "/***/virtualenvs/***-njgrPu0H/lib/python3.7/site-packages/pyexasol/connection.py", line 836, in __exit__
    self.close()
  File "/***/virtualenvs/***-njgrPu0H/lib/python3.7/site-packages/pyexasol/connection.py", line 479, in close
    self._ws.close()
  File "/***/virtualenvs/***-njgrPu0H/lib/python3.7/site-packages/websocket/_core.py", line 491, in close
    self.sock.settimeout(sock_timeout)
AttributeError: 'NoneType' object has no attribute 'settimeout'

The error cannot be reproduced with version before 1.0.0 (0.59.0) or after 1.0.0 (1.0.1)

littleK0i commented 3 years ago

Wow. websocket-client was abandoned for a while. What a surprise. I'll take a look.

I guess, I'll have to add an exclusion for this version in in dependencies.

littleK0i commented 3 years ago

Ok, it is definitely related to the fix in 1.0.1: https://github.com/websocket-client/websocket-client/commit/0e4298a7b1876f3f8ad97b1ab27f3b283d6ea148

So the exception was always there, but it is muted prior or after 1.0.0.

I've added 1.0.0 to explicit exclusions, it won't hurt: https://github.com/badoo/pyexasol/commit/292e2d9c2da0db953317a221d26a99025a11b8bd

It will go live with the next update.

Thank you.

smaspe commented 3 years ago

Cool, thanks!