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

http.client.InvalidURL: URL can't contain control characters. '192.168.129.6:3910 http' (found at least ' ') #199

Closed
bigon opened this issue Feb 17, 2024 · 6 comments
Labels
duplicate This issue or pull request already exists

Comments

@bigon
Copy link

bigon commented Feb 17, 2024

Hello,

I'm just experimenting with wsdd now that GNOME is using it, and I can see a stacktrace on my system:

2024-02-17 15:21:06,133:asyncio ERROR(pid 8484): Exception in callback MulticastHandler.read_socket(<socket.socke....0.0', 47444)>)
handle: <Handle MulticastHandler.read_socket(<socket.socke....0.0', 47444)>)>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/bin/wsdd", line 328, in read_socket
    handler.handle_packet(msg.decode('utf-8'), address)
  File "/usr/bin/wsdd", line 739, in handle_packet
    self.handle_message(msg, src)
  File "/usr/bin/wsdd", line 532, in handle_message
    retval = handler(header, body)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/wsdd", line 795, in handle_probe_match
    self.perform_metadata_exchange(endpoint, xaddr)
  File "/usr/bin/wsdd", line 846, in perform_metadata_exchange
    with urllib.request.urlopen(request, None, 2.0) as stream:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 519, in open
    response = self._open(req, data)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 1377, in http_open
    return self.do_open(http.client.HTTPConnection, req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 1317, in do_open
    h = http_class(host, timeout=req.timeout, **http_conn_args)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/http/client.py", line 865, in __init__
    self._validate_host(self.host)
  File "/usr/lib/python3.11/http/client.py", line 1251, in _validate_host
    raise InvalidURL(f"URL can't contain control characters. {host!r} "
http.client.InvalidURL: URL can't contain control characters. '192.168.129.6:3910  http' (found at least ' ')

192.168.129.6 is a "HP LaserJet P2055dn" printer

@bigon
Copy link
Author

bigon commented Feb 17, 2024

debug log

@bigon
Copy link
Author

bigon commented Feb 17, 2024

@christgau
Copy link
Owner

Looks like a duplicate of #149 which was fixed in c4a5f34.

Also looks like a new release should be made so that Gnome can use it. I assume it's v0.7.1 that is used on your machine. You can check with wsdd --version. If it's a newer commit, feel free to re-open.

@christgau christgau added the duplicate This issue or pull request already exists label Feb 17, 2024
@bigon
Copy link
Author

bigon commented Feb 18, 2024

FTR I'm indeed running 0.7.1

$ wsdd --version
wsdd - Web Service Discovery Daemon, v0.7.1

I've retried with c4a5f34 applied and it's indeed now working

@bigon
Copy link
Author

bigon commented Feb 25, 2024

@christgau Do you have an ETA for a new release?

@christgau
Copy link
Owner

Do you have an ETA for a new release?

Anytime soon... or later 😬 Depends on my not-so-side-project duties. I'd like to integrate the OpenBSD branch as well. Should be trivial but needs some time too. But. Be assured, the release is not forgotten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants