Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Detected blocking call to open with args ('/usr/local/lib/python3.13/site-packages/pytz/zoneinfo/Africa/Abidjan', 'rb') #705

Open
flamestsui opened this issue Mar 6, 2025 · 1 comment

Comments

@flamestsui
Copy link

2025-03-06 16:39:41.825 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/usr/local/lib/python3.13/site-packages/pytz/zoneinfo/Africa/Abidjan', 'rb') inside the event loop by custom integration 'pyscript' at custom_components/pyscript/eval.py, line 1982: return func(*args, **kwargs) (offender: /usr/local/lib/python3.13/site-packages/pytz/init.py, line 108: return open(filename, 'rb')), please create a bug report at https://github.com/custom-components/pyscript/issues
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/usr/src/homeassistant/homeassistant/main.py", line 227, in
sys.exit(main())
File "/usr/src/homeassistant/homeassistant/main.py", line 213, in main
exit_code = runner.run(runtime_conf)
File "/usr/src/homeassistant/homeassistant/runner.py", line 154, in run
return loop.run_until_complete(setup_and_run_hass(runtime_config))
File "/usr/local/lib/python3.13/asyncio/base_events.py", line 707, in run_until_complete
self.run_forever()
File "/usr/local/lib/python3.13/asyncio/base_events.py", line 678, in run_forever
self._run_once()
File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2033, in _run_once
handle._run()
File "/usr/local/lib/python3.13/asyncio/events.py", line 89, in _run
self._context.run(self._callback, *self._args)
File "/config/custom_components/pyscript/function.py", line 448, in run_coro
result = await coro
File "/config/custom_components/pyscript/trigger.py", line 1380, in do_func_call
await ast_ctx.call_func(func, None, **kwargs)
File "/config/custom_components/pyscript/eval.py", line 1952, in call_func
return await func.call(self, *args, **kwargs)
File "/config/custom_components/pyscript/eval.py", line 800, in call
val = await self.try_aeval(ast_ctx, arg1)
File "/config/custom_components/pyscript/eval.py", line 700, in try_aeval
return await ast_ctx.aeval(arg)
File "/config/custom_components/pyscript/eval.py", line 940, in aeval
val = await getattr(self, name, self.ast_not_implemented)(arg)
File "/config/custom_components/pyscript/eval.py", line 1224, in ast_try
val = await self.aeval(arg1)
File "/config/custom_components/pyscript/eval.py", line 940, in aeval
val = await getattr(self, name, self.ast_not_implemented)(arg)
File "/config/custom_components/pyscript/eval.py", line 1468, in ast_assign
rhs = await self.aeval(arg.value)
File "/config/custom_components/pyscript/eval.py", line 940, in aeval
val = await getattr(self, name, self.ast_not_implemented)(arg)
File "/config/custom_components/pyscript/eval.py", line 1937, in ast_call
return await self.call_func(func, func_name, *args, **kwargs)
File "/config/custom_components/pyscript/eval.py", line 1982, in call_func
return func(*args, **kwargs)

@craigbarratt
Copy link
Member

Updated title. Duplicate of #687: pytz uses lazy loading, so you should use zoneinfo instead.

@craigbarratt craigbarratt changed the title error Detected blocking call to open with args ('/usr/local/lib/python3.13/site-packages/pytz/zoneinfo/Africa/Abidjan', 'rb') Mar 6, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants