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
File "/home/idwaker/Code/webapp/app/api/common/utils/loaders.py", line 43, in init_cors
cors = aiohttp_cors.setup(app, defaults=CORS_DEFAULTS)
File "/home/idwaker/.local/share/virtualenvs/webapp-69lhAx_Z/lib/python3.6/site-packages/aiohttp_cors/__init__.py", line 65, in setup
cors = CorsConfig(app, defaults=defaults)
File "/home/idwaker/.local/share/virtualenvs/webapp-69lhAx_Z/lib/python3.6/site-packages/aiohttp_cors/cors_config.py", line 247, in __init__
self._resources_router_adapter)
File "/home/idwaker/.local/share/virtualenvs/webapp-69lhAx_Z/lib/python3.6/site-packages/aiohttp_cors/cors_config.py", line 117, in __init__
self._app.on_response_prepare.append(self._on_response_prepare)
File "aiohttp/_frozenlist.pyx", line 97, in aiohttp._frozenlist.FrozenList.append
File "aiohttp/_frozenlist.pyx", line 19, in aiohttp._frozenlist.FrozenList._check_frozen
RuntimeError: Cannot modify frozen list.
on latest 3.0 release of aiohttp
my init_cors is something like this
asyncdefinit_cors(app: web.Application):
logger=get_logger(app['name'])
cors=aiohttp_cors.setup(app, defaults=CORS_DEFAULTS)
# add resources to corsforresourceinlist(app.router.resources()):
ifisinstance(resource, web.Resource):
cors.add(resource)
logger.info("Initialized CORS for {}".format(app['name']))
and i am loading init_cors on app.on_startup
The issue seems to occur when i defer cors setup to on_startup signal like
app.on_startup.append(init_cors)
But it works normally if i put the cors init code on app setup like
I don't think the appending cors setup to startup signal was good idea anyway, so i removed that with simple function call for setup which works as desired.
aiohttp cors setup breaks with
on latest 3.0 release of aiohttp
my init_cors is something like this
and i am loading init_cors on app.on_startup
The issue seems to occur when i defer cors setup to on_startup signal like
But it works normally if i put the cors init code on app setup like
The text was updated successfully, but these errors were encountered: