x86-info-term
x86-info-term copied to clipboard
Set a generic user agent for Intel Intrinsic Guide data
First of all, thank you very much for developing this utility!
The Intel site recently started to silently refuse the urllib user agent, and the xml file download will never been finished:
>>> import urllib.request
>>> url = 'https://software.intel.com/content/dam/develop/public/us/en/include/intrinsics-guide/data-latest.xml'
>>> urllib.request.urlopen(url, timeout=5).reason
Traceback (most recent call last):
...
socket.timeout: The read operation timed out
This pull request sets a generic user agent (Mozilla/5.0
) as a workaround:
>>> req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0'})
>>> urllib.request.urlopen(req, timeout=5).reason
OK