I get a different error but another issue with upnp.discover():
>>> upnp.discover()
Traceback (most recent call last):
File "/usr/lib/python3.6/http/client.py", line 897, in _get_hostport
port = int(host[i+1:])
ValueError: invalid literal for int() with base 10: '49152wps_scpd.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/upnpy/upnp/UPnP.py", line 33, in discover
for device in self.ssdp.m_search(discover_delay=delay, st='upnp:rootdevice', **headers):
File "/usr/local/lib/python3.6/dist-packages/upnpy/ssdp/SSDPRequest.py", line 50, in m_search
devices = self._send_request(self._get_raw_request())
File "/usr/local/lib/python3.6/dist-packages/upnpy/ssdp/SSDPRequest.py", line 100, in _send_request
device = SSDPDevice(addr, response.decode())
File "/usr/local/lib/python3.6/dist-packages/upnpy/ssdp/SSDPDevice.py", line 87, in __init__
self._get_services_request()
File "/usr/local/lib/python3.6/dist-packages/upnpy/ssdp/SSDPDevice.py", line 23, in wrapper
return func(device, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/upnpy/ssdp/SSDPDevice.py", line 54, in wrapper
return func(instance, *args, **kwargs)
File "/usr/local/lib/python3.6/dist-packages/upnpy/ssdp/SSDPDevice.py", line 179, in _get_services_request
base_url=base_url
File "/usr/local/lib/python3.6/dist-packages/upnpy/ssdp/SSDPDevice.py", line 257, in __init__
self._get_description_request()
File "/usr/local/lib/python3.6/dist-packages/upnpy/ssdp/SSDPDevice.py", line 289, in _get_description_request
service_description = utils.make_http_request(self.base_url + self.scpd_url).read()
File "/usr/local/lib/python3.6/dist-packages/upnpy/utils.py", line 81, in make_http_request
return urllib.request.urlopen(request)
File "/usr/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/usr/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/usr/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/lib/python3.6/urllib/request.py", line 1353, in http_open
return self.do_open(http.client.HTTPConnection, req)
File "/usr/lib/python3.6/urllib/request.py", line 1293, in do_open
h = http_class(host, timeout=req.timeout, **http_conn_args)
File "/usr/lib/python3.6/http/client.py", line 859, in __init__
(self.host, self.port) = self._get_hostport(host, port)
File "/usr/lib/python3.6/http/client.py", line 902, in _get_hostport
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
http.client.InvalidURL: nonnumeric port: '49152wps_scpd.xml'
Original post:
I get a different error but another issue with
upnp.discover()
:Originally posted by @nashant in https://github.com/5kyc0d3r/upnpy/issues/7#issuecomment-657202199