Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in adapter.ws.py, logging module should be imported from stomp #404

Closed
iamsnj opened this issue Sep 24, 2022 · 1 comment
Closed

in adapter.ws.py, logging module should be imported from stomp #404

iamsnj opened this issue Sep 24, 2022 · 1 comment

Comments

@iamsnj
Copy link

iamsnj commented Sep 24, 2022

Hello,
I am using dev branch code.
I am getting the below error while connecting to a WebSocket server (ws://localhost:8080/work/websocket). There is a logging module in stomp directory. Its name is matching with python's existing module, so there rises a conflict. To avoid this conflict, we must import like import stomp.logging as logging in adpater/ws.py module or we can rename stomp.logging module to something else such that it does not match any existing module. There can be more such cases.

Traceback (most recent call last):
File "/home/sanjay/webs/lib/python3.10/site-packages/stomp/adapter/ws.py", line 338, in attempt_connection
self.socket = websocket.create_connection(
File "/home/sanjay/webs/lib/python3.10/site-packages/websocket/_core.py", line 605, in create_connection
websock.connect(url, **options)
File "/home/sanjay/webs/lib/python3.10/site-packages/websocket/_core.py", line 246, in connect
self.sock, addrs = connect(url, self.sock_opt, proxy_info(**options),
File "/home/sanjay/webs/lib/python3.10/site-packages/websocket/_http.py", line 130, in connect
sock = _open_socket(addrinfo_list, options.sockopt, options.timeout)
File "/home/sanjay/webs/lib/python3.10/site-packages/websocket/_http.py", line 205, in _open_socket
raise err
File "/home/sanjay/webs/lib/python3.10/site-packages/websocket/_http.py", line 185, in _open_socket
sock.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/sanjay/websocket-client/ws_client.py", line 28, in
conn.connect(wait=True, headers=header, with_connect_command=True)
File "/home/sanjay/webs/lib/python3.10/site-packages/stomp/connect.py", line 198, in connect
self.transport.start()
File "/home/sanjay/webs/lib/python3.10/site-packages/stomp/transport.py", line 108, in start
self.attempt_connection()
File "/home/sanjay/webs/lib/python3.10/site-packages/stomp/adapter/ws.py", line 349, in attempt_connection
str(exc), exc_info=logging.verbose)
AttributeError: module 'logging' has no attribute 'verbose'

@jasonrbriggs
Copy link
Owner

Fixed. Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants