Closed mbevilacqua closed 3 months ago
FWIW I did get it to run with the following construct but a more seamless experience for Cloud Functions, if possible, would be appreciated.
try:
event_loop = asyncio.get_event_loop()
except RuntimeError as e:
event_loop = asyncio.new_event_loop()
asyncio.set_event_loop(event_loop)
hello @mbevilacqua,
does the same issue happen with modern versions of python? such as python 3.11. I'm asking since python 3.8 is quite old. It shouldn't be much of a problem to update to a modern version of python.
Thanks!
Yes, same thing happens with 3.12, I need the extra try/catch to run this as a cloud function.
I am getting the same error when using this library in a WSGI web application. Rolling back to version 0.17.5 fixes the issue. Caused by 87ab6870ddb476c3cc9c854a89caaf8f1cf5374f. Related: #21
Checked this again using this tester:
import flask
import os
import vt
app = flask.Flask(__name__)
@app.get('/')
def home():
with vt.Client(os.getenv('VT_APIKEY')) as c:
g = c.get('/domains/google.com')
return g.json()
The problem is that the TCPConnector
connector expects to be called inside an async coroutine. Thank you for reporting, I'm already working on a fix :)
Having issues trying to get vt-py running in a GCP Cloud Function. Some quick googling around lead to a similar-looking bug in the cloud-sql-python-connect