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
Detected blocking call to open inside the event loop by custom integration 'auto_backup' at custom_components/auto_backup/handlers.py, line 146: with open(destination, "wb") as file: (offender: /config/custom_components/auto_backup/handlers.py, line 146: with open(destination, "wb") as file:), please create a bug report at https://github.com/jcwillox/hass-auto-backup/issues 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 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, 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 "/config/custom_components/auto_backup/handlers.py", line 146, in download_backup with open(destination, "wb") as file:
What version of Auto Backup has the issue?
1.5.0
What version of Home Assistant are you running?
Home Assistant Core 2024.6.3
What type of installation are you running?
Home Assistant OS
If you're running HA OS/Supervised, what version of the Supervisor are you running?
Supervisor 2024.06.0
Example YAML snippet
Core 2024.6.3Supervisor 2024.06.0Operating System 12.3
- Resolved Home Assistant warning about blocking file operations in the `auto_backup` integration (jcwillox#145).
- Updated `handlers.py` to replace synchronous `open` calls with `aiofiles.open` for non-blocking file writes.
- Improved compatibility with Home Assistant's asyncio architecture, preventing event loop warnings.
- Verified changes to ensure integration functionality remains intact.
I've addressed the blocking file operation warning by replacing synchronous file writes with aiofiles. This should resolve the issue while maintaining the integration's functionality.
The problem
homeassistant.util.loop
util/loop.py:84
Detected blocking call to open inside the event loop by custom integration 'auto_backup' at custom_components/auto_backup/handlers.py, line 146: with open(destination, "wb") as file: (offender: /config/custom_components/auto_backup/handlers.py, line 146: with open(destination, "wb") as file:), please create a bug report at https://github.com/jcwillox/hass-auto-backup/issues 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 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 672, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 639, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1988, 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 "/config/custom_components/auto_backup/handlers.py", line 146, in download_backup with open(destination, "wb") as file:
What version of Auto Backup has the issue?
1.5.0
What version of Home Assistant are you running?
Home Assistant Core 2024.6.3
What type of installation are you running?
Home Assistant OS
If you're running HA OS/Supervised, what version of the Supervisor are you running?
Supervisor 2024.06.0
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: