urllib.error.HTTPError: HTTP Error 404: Not Found
See original GitHub issueSometimes it finds more hosts, but mostly it just fails with the below stacktrace.
Ubuntu 18.04 w/ Python3 VENV, Python v3.6.9
Traceback (most recent call last):
File "CallStranger.py", line 113, in <module>
devices = upnp.discover()
File "/opt/callstranger/upnpy/upnp/UPnP.py", line 33, in discover
for device in self.ssdp.m_search(discover_delay=delay, st='upnp:rootdevice', **headers):
File "/opt/callstranger/upnpy/ssdp/SSDPRequest.py", line 49, in m_search
devices = self._send_request(self._get_raw_request())
File "/opt/callstranger/upnpy/ssdp/SSDPRequest.py", line 100, in _send_request
device = SSDPDevice(addr, response.decode())
File "/opt/callstranger/upnpy/ssdp/SSDPDevice.py", line 82, in __init__
self._get_description_request(utils.parse_http_header(response, 'Location'))
File "/opt/callstranger/upnpy/ssdp/SSDPDevice.py", line 115, in _get_description_request
device_description = utils.make_http_request(url).read()
File "/opt/callstranger/upnpy/utils.py", line 80, 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 532, in open
response = meth(req, response)
File "/usr/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
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 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (7 by maintainers)
Top Results From Across the Web
Python: urllib.error.HTTPError: HTTP Error 404: Not Found
This code will catch the 404 error which was the reason you got an error and ignore it just in case you go...
Read more >[BUG] urllib.error.HTTPError: HTTP Error 404: Not Found #1021
Describe the bug urllib.error.HTTPError: HTTP Error 404: Not Found cannot download video or list out streams (sometimes the download did ...
Read more >urllib.error.HTTPError: HTTP Error 404: Not Found - Ask Ubuntu
Your problem is that you're not adding data as a query parameter, indicated by adding a ? after /search. Here is your code...
Read more >urllib.error.HTTPError: HTTP Error 404: Not Found - YouTube
Topic : urllib. error. HTTPError : HTTP Error 404 : Not ...
Read more >HTTPError: HTTP Error 404: Not Found in python 3
import urllib.request def get_site_html(url): source = urllib.request.urlopen(url).read() return source. I am trying to create this function but it throws ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi there are too many devices. I broaded exception handling. can you try again?
So the outcome is now stable with 7 upnp devices, however I still get the 404