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
Post a Comment