Catching ValueError: unknown url type: urllib2 Python -


i'm getting following exception when enter invalid url: valueerror: unknown url type: blob

i'm trying catch error following code it's not working:

try:     req = urllib2.request(url)     conn =  urllib2.urlopen(req)     content = conn.read() except urllib2.urlerror, e:     print 'error: invalid url' 

if notice, base error valueerror, so

import urllib2 url = 'blob' try:     req = urllib2.request(url)     conn =  urllib2.urlopen(req)     content = conn.read() except valueerror, e:     print 'error: invalid url' 

Comments

Popular posts from this blog

Prolog - Listing -

orchardcms - change base url in local copy in Orchard CMS -

linear regression - Trying to get confidence/prediction intervals with `predict.lm` in R, but I keep getting an error regarding my dichotomous variable -