python-google-places icon indicating copy to clipboard operation
python-google-places copied to clipboard

Add option to add timeout property to `urlopen` call

Open commadelimited opened this issue 10 years ago • 2 comments

When making calls to Google via urlopen: https://github.com/slimkrazy/python-google-places/blob/master/googleplaces/init.py#L68

there's no timeout specified. This means that the call will default to no timeout, or infinite. It would be great to be able to specific a timeout option on a method by method basis, or even a default timeout when instantiating the lib for the first time. Perhaps something like this:

google_places = googleplaces.GooglePlaces(
    settings.GOOGLE_PLACES_API_KEY,
    timeout=2
)

commadelimited avatar Nov 13 '15 17:11 commadelimited

Bump

commadelimited avatar Jun 21 '16 19:06 commadelimited

PR #57 has a module constant. You want to update that with your suggestion? Use the constant timeout as default, allowing for the dev to override when they instantiate the top-level object?

slimkrazy avatar Jun 28 '16 21:06 slimkrazy