Re: n00b confusion re: local variable referenced before assignment error

2009-06-19 Thread Dave Angel
Wells Oliver wrote: Writing a class which essentially spiders a site and saves the files locally. On a URLError exception, it sleeps for a second and tries again (on 404 it just moves on). The relevant bit of code, including the offending method: class Handler(threading.Thread): def __in

Re: n00b confusion re: local variable referenced before assignment error

2009-06-19 Thread Mike Kazantsev
On Fri, 19 Jun 2009 11:16:38 -0500 Wells Oliver wrote: > def save(self, uri, location): > try: > handler = urllib2.urlopen(uri) > except urllib2.HTTPError, e: > if e.code == 404: >

Re: n00b confusion re: local variable referenced before assignment error

2009-06-19 Thread Diez B. Roggisch
Wells Oliver schrieb: Writing a class which essentially spiders a site and saves the files locally. On a URLError exception, it sleeps for a second and tries again (on 404 it just moves on). The relevant bit of code, including the offending method: class Handler(threading.Thread): def

Re: n00b confusion re: local variable referenced before assignment error

2009-06-19 Thread Falcolas
On Jun 19, 10:16 am, Wells Oliver wrote: > Writing a class which essentially spiders a site and saves the files > locally. On a URLError exception, it sleeps for a second and tries again (on > 404 it just moves on). The relevant bit of code, including the offending > method: > > [snip] > > But wha

n00b confusion re: local variable referenced before assignment error

2009-06-19 Thread Wells Oliver
Writing a class which essentially spiders a site and saves the files locally. On a URLError exception, it sleeps for a second and tries again (on 404 it just moves on). The relevant bit of code, including the offending method: class Handler(threading.Thread): def __init__(self, url):