gchq / gaffer-tools

gaffer-tools is deprecated. Use https://github.com/gchq/gafferpy instead
Apache License 2.0
50 stars 29 forks source link

Fix warnings in the gafferpy connectors #910

Closed t92549 closed 3 years ago

t92549 commented 3 years ago

Found while running new GitHub Actions CI:

/home/runner/work/gaffer-tools/gaffer-tools/python-shell/src/gafferpy/gaffer_connector.py:108: SyntaxWarning: "is not" with a literal. Did you mean "!="?
2021-07-02T16:05:47.6720174Z   if response_text is not None and response_text is not '':
2021-07-02T16:05:47.6721791Z /home/runner/work/gaffer-tools/gaffer-tools/python-shell/src/gafferpy/gaffer_connector_requests.py:113: SyntaxWarning: "is not" with a literal. Did you mean "!="?
2021-07-02T16:05:47.6723519Z   if response_json is not None and response_json is not '':
2021-07-02T16:05:53.5992861Z ......./usr/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::1', 55226, 0, 0), raddr=('::1', 8080, 0, 0)>
2021-07-02T16:05:53.5994617Z   method()
2021-07-02T16:05:53.5995583Z ResourceWarning: Enable tracemalloc to get the object allocation traceback
2021-07-02T16:05:53.6101558Z ./usr/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::1', 55228, 0, 0), raddr=('::1', 8080, 0, 0)>
2021-07-02T16:05:53.6103227Z   method()
2021-07-02T16:05:53.6104159Z ResourceWarning: Enable tracemalloc to get the object allocation traceback
2021-07-02T16:05:53.6300666Z ./usr/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::1', 55230, 0, 0), raddr=('::1', 8080, 0, 0)>
2021-07-02T16:05:53.6303922Z   method()
2021-07-02T16:05:53.6304888Z ResourceWarning: Enable tracemalloc to get the object allocation traceback
2021-07-02T16:05:53.6357119Z ./usr/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::1', 55232, 0, 0), raddr=('::1', 8080, 0, 0)>
2021-07-02T16:05:53.6358656Z   method()
2021-07-02T16:05:53.6359590Z ResourceWarning: Enable tracemalloc to get the object allocation traceback
2021-07-02T16:05:53.6408814Z ./usr/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed <socket.socket fd=3, family=AddressFamily.AF_INET6, type=SocketKind.SOCK_STREAM, proto=6, laddr=('::1', 55234, 0, 0), raddr=('::1', 8080, 0, 0)>
2021-07-02T16:05:53.6410327Z   method()
2021-07-02T16:05:53.6411251Z ResourceWarning: Enable tracemalloc to get the object allocation traceback

There are 2 real issues here: