python-nostr icon indicating copy to clipboard operation
python-nostr copied to clipboard

AttributeError: 'NoneType' object has no attribute 'host'

Open xavierfiechter opened this issue 2 years ago • 1 comments

>>> import json
>>> import ssl
>>> import time
>>> from nostr.relay_manager import RelayManager
>>>
>>> relay_manager = RelayManager()
>>> relay_manager.add_relay("wss://nostr-pub.wellorder.net")
Exception in thread wss://nostr-pub.wellorder.net-thread:
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/root/python-nostr/nostr/relay.py", line 55, in connect
    http_proxy_host=self.proxy_config.host,
AttributeError: 'NoneType' object has no attribute 'host'
>>> relay_manager.add_relay("wss://relay.damus.io")
Exception in thread wss://relay.damus.io-thread:
Traceback (most recent call last):
  File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/root/python-nostr/nostr/relay.py", line 55, in connect
    http_proxy_host=self.proxy_config.host,
AttributeError: 'NoneType' object has no attribute 'host'
>>> relay_manager.open_connections({"cert_reqs": ssl.CERT_NONE}) # NOTE: This disables ssl certificate verification
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'RelayManager' object has no attribute 'open_connections'

xavierfiechter avatar Feb 15 '23 12:02 xavierfiechter

Bug in the tip of the repo as of https://github.com/jeffthibault/python-nostr/commit/a2b2efd9aff086e6de37d2fa0e3cf8b0993fd712.

Connection works in the same venv with the code base installed from PyPi.

xavierfiechter avatar Feb 15 '23 12:02 xavierfiechter