If exception is raised in the line "result = urlfetch.fetch(url)",
then the "result" variable will not be set. Trying to access it's
"content" attribute after the exception will raise UnboundLocalError
as the "result" variable simply does not exist. Your code was working
by accident.

warreninaustintexas napisaƂ(a):
> My app has been working since October of last year.  My app scrapes
> stock data from Yahoo! Finance and Google Finance.  I haven't changed
> the way it does urlfetch in many months, but today it is suddenly
> throwing errors that I haven't had before.
>
> Relevant portion of code:
>
>     url = "http://finance.google.com/finance?q="; + ticker_symbol
>     try:
>       result = urlfetch.fetch(url)
>     except (urlfetch.DownloadError):
>       isPageSlow = True
>     strbig = result.content
>
> I'm getting a "UnboundLocalError: local variable 'result' referenced
> before assignment" error on the last line of the above code.  Has App
> Engine changed the way it handles slow page fetches?
>
> The app's been running fine for months.  It runs fine on
> dev_appserver, too - I can't duplicate the error locally.
>
> View the app at stockpickmodel dot appspot dot com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to