You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did originally try experimenting with setting the socket default timeout value in an interactive repl and then importing a custom google drive wrapper around the service object, which did not seem to affect the default timeout, for what it's worth. Hope this helps.
Reacted by trevorbalint, Ken, Maciej Brencz, Michael Trossbach, Alexandr Uliantsev, Vinayak Bagaria, Carlos Alexandre and Dennis
I did originally try experimenting with setting the socket default timeout value in an interactive repl and then importing a custom google drive wrapper around the service object, which did not seem to affect the default timeout, for what it's worth. Hope this helps.
I have same problem to use google sheets api. Although I can ping www.google.com and access google website ( by shadowsocks since I am in China), the result of ping www.googleapis.com is request time out.
I think that is the reason why pygsheets and gspread raise socket.time out error as in issue.
I am wondering is there any restriction to access googleapis.com behind network proxy?
I find this pretty important since some operations with very large spreadsheets require a very large timeout. I would prefer to set this on the individual requests I know will be slow.
+1. It will be very helpful to be able to set per-request timeout. We work with a service which has some long running methods. We'd like to set longer timeout for these methods only.
Reacted by Maggie Nolan Edmonds, Sascha Heyer, Anton Vlasenko, Jason Whaley, Joshua Adelman and Thomas LÉVEIL
@AlJohri@jqll -- I'm not sure if there is a better way to do this, but I was also looking for a way to more locally set a timeout without altering the timeout behavior of all sockets and came up with the following:
If I set timeout to something small like 0.1, then when I execute on a request built from the service, it raises timeout: The read operation timed out. You can also check that req.http.http.timeout has the correct value set.
Reacted by Ben Youngblut, Thomas LÉVEIL, Savir, yahani hewagama, Cyrille Epalle, Conrad Kleinespel, Samy Laumonier and Avery
Activity
theacodes commentedon Feb 20, 2018
You should be able to set the global socket timeout.
ryantuck commentedon Jun 6, 2018
a working example of how setting the global socket timeout would solve this issue would be helpful. will update this issue if i find one.
ryantuck commentedon Jun 6, 2018
Results for this issue are surprisingly sparse on google! Here's how I made this work (for uploading large files to google drive):
I did originally try experimenting with setting the socket default timeout value in an interactive repl and then
importing a custom google drive wrapper around theserviceobject, which did not seem to affect the default timeout, for what it's worth. Hope this helps.lidatou1991 commentedon May 28, 2019
I have same problem to use google sheets api. Although I can ping www.google.com and access google website ( by shadowsocks since I am in China), the result of ping www.googleapis.com is request time out.
I think that is the reason why pygsheets and gspread raise socket.time out error as in issue.
I am wondering is there any restriction to access googleapis.com behind network proxy?
AlJohri commentedon Sep 19, 2019
Thank you so much @ryantuck! Linking this issue since google kept taking me there instead of here: #632
Is there an alternative way to set the timeout more locally? I see that this library relies on httplib2 which provides a mechanism for providing a timeout. This class, which is used in the quickstart for authentication also provides a timeout parameter: https://google-auth.readthedocs.io/en/latest/reference/google.auth.transport.requests.html
I find this pretty important since some operations with very large spreadsheets require a very large timeout. I would prefer to set this on the individual requests I know will be slow.
jqll commentedon Sep 26, 2019
+1. It will be very helpful to be able to set per-request timeout. We work with a service which has some long running methods. We'd like to set longer timeout for these methods only.
synapticarbors commentedon Jul 1, 2020
@AlJohri @jqll -- I'm not sure if there is a better way to do this, but I was also looking for a way to more locally set a timeout without altering the timeout behavior of all sockets and came up with the following:
If I set timeout to something small like
0.1, then when I execute on a request built from the service, it raisestimeout: The read operation timed out. You can also check thatreq.http.http.timeouthas the correct value set.