hass-pronote icon indicating copy to clipboard operation
hass-pronote copied to clipboard

Detected blocking call to open with args

Open HiFuGa opened this issue 1 year ago • 4 comments

Bonjour,

J'ai HAOS avec ces versions :

Core : 2024.9.3 Supervisor : 2024.09.1 Operating System : 13.1 Interface utilisateur : 20240909.1

HASS-Pronote : 1.14.4

Depuis la mise à jour du Core de Home Assistant en 2024.9.3, j'ai ce défaut dans le journal au démarrage de Home Assistant :

Enregistreur: homeassistant.util.loop Source: util/loop.py:136 S'est produit pour la première fois: 18:18:34 (2 occurrences) Dernier enregistrement: 18:18:39

Detected blocking call to open with args ('/usr/local/lib/python3.12/site-packages/pytz/zoneinfo/Africa/Abidjan', 'rb') inside the event loop by custom integration 'pronote' at custom_components/pronote/coordinator.py, line 182: tz = pytz.timezone(self.hass.config.time_zone) (offender: /usr/local/lib/python3.12/site-packages/pytz/init.py, line 108: return open(filename, 'rb')), please create a bug report at https://github.com/delphiki/hass-pronote/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 223, in sys.exit(main()) File "/usr/src/homeassistant/homeassistant/main.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 752, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 604, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/pronote/init.py", line 45, in async_setup_entry await coordinator.async_config_entry_first_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 281, in async_config_entry_first_refresh await self._async_refresh( File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 354, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/pronote/coordinator.py", line 182, in _async_update_data tz = pytz.timezone(self.hass.config.time_zone)

Merci !

HiFuGa avatar Sep 29 '24 16:09 HiFuGa

Hello @HiFuGa,

Est-ce que tu as toujours le souci sur la dernière version de l'intégration et la dernière version d'HA ?

delphiki avatar Dec 07 '24 10:12 delphiki

Bonjour,

Moi avec la dernière version HA (2024.12.2) et la dernière Pronote (1.15.2) j'ai l'erreur. Je ne l'avais pas avant ces 2 MAJ (j'ai enchainé les 2 donc pas vu laquelle a déclenché cela).

Enregistreur: homeassistant.util.loop
Source: util/loop.py:136
S'est produit pour la première fois: 16:00:34 (1 occurrences)
Dernier enregistrement: 16:00:34

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 'pronote' at custom_components/pronote/coordinator.py, line 213: tz = pytz.timezone(self.hass.config.time_zone) (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/delphiki/hass-pronote/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 227, in <module> 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 708, in run_until_complete self.run_forever() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 679, in run_forever self._run_once() File "/usr/local/lib/python3.13/asyncio/base_events.py", line 2027, 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 "/usr/src/homeassistant/homeassistant/config_entries.py", line 788, in async_setup_locked await self.async_setup(hass, integration=integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup await self.__async_setup_with_context(hass, integration) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 640, in __async_setup_with_context result = await component.async_setup_entry(hass, self) File "/config/custom_components/pronote/__init__.py", line 43, in async_setup_entry await coordinator.async_config_entry_first_refresh() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 306, in async_config_entry_first_refresh await self._async_refresh( File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 379, in _async_refresh self.data = await self._async_update_data() File "/config/custom_components/pronote/coordinator.py", line 213, in _async_update_data tz = pytz.timezone(self.hass.config.time_zone)

Je précise que la timezone de mon HA est sur Europe/Paris

mguyard avatar Dec 12 '24 15:12 mguyard

Hello,

Je viens de publier un correctif avec la version 1.15.3, est-ce que vous pouvez tester ?

delphiki avatar Dec 12 '24 21:12 delphiki

Merci @delphiki,

Le log n'est plus présent au redémarrage de HA suite à la MaJ

mguyard avatar Dec 13 '24 14:12 mguyard