Receiving an error when attempting to open a url link with urlopen

18 Views Asked by At

I am attempting to run this portion of my code that used to work before, but now I get the following error, urllib2.URLError: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:661). It never used to do that, and everything worked fine. The line that fails is the urlopen. Does anyone have any suggestions? I am using Python 2.7 and I am aware it is very outdated.

image_url = 'https://openweathermap.org/img/wn/'+icon+'@2x.png'
image_str = urlopen(image_url).read()

Was expecting it to open the weather icon like it used to.

0

There are 0 best solutions below