# HG changeset patch # User k0s # Date 1263492406 18000 # Node ID 04866e5abb5afee206757c81dba64bafc6e57d8b # Parent 94dddb3a5d775e08ef58bd0c5c7be4ad2f379e1b try a few times before giving up diff -r 94dddb3a5d77 -r 04866e5abb5a bitsyblog/blogme.py --- a/bitsyblog/blogme.py Thu Jan 14 13:06:36 2010 -0500 +++ b/bitsyblog/blogme.py Thu Jan 14 13:06:46 2010 -0500 @@ -133,11 +133,15 @@ authhandler.add_password('bitsyblog', url, options.user, options.password) opener = urllib2.build_opener(authhandler) urllib2.install_opener(opener) - try: - url = urllib2.urlopen(url, data=msg) - print url.url # print the blog post's url - except urllib2.HTTPError, e: - print e + attempts = 5 + for i in range(attempts): + try: + connection = urllib2.urlopen(url, data=msg) + print connection.url # print the blog post's url + break + except urllib2.HTTPError, e: + import pdb; pdb.set_trace() + print e if __name__ == '__main__': main()