Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Detected blocking call to open with args #142

Open
elijahr opened this issue Jan 2, 2025 · 0 comments
Open

Detected blocking call to open with args #142

elijahr opened this issue Jan 2, 2025 · 0 comments

Comments

@elijahr
Copy link

elijahr commented Jan 2, 2025

I see the following warning in my logs:

Logger: homeassistant.util.loop
Source: util/loop.py:136
First occurred: 1:20:37 AM (1 occurrences)
Last logged: 1:20:37 AM
Detected blocking call to open with args ('/usr/local/lib/python3.13/site-packages/pycountry/databases/iso3166-1.json',) inside the event loop by custom integration 'tuya_ble' at custom_components/tuya_ble/config_flow.py, line 117:
def_country = pycountry.countries.get(alpha_2=flow.hass.config.country)
(offender: /usr/local/lib/python3.13/site-packages/pycountry/db.py, line 83: with open(self.filename, encoding="utf-8") as f:), please report it to the author of the 'tuya_ble' custom integration
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/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 559, in start
        task = asyncio.Task(coro, loop=loop, eager_start=True)
    File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
        resp = await request_handler(request)
    File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
        return await handler(request)
    File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
        return await handler(request)
    File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
        return await handler(request)
    File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
        return await handler(request)
    File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
        return await handler(request)
    File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
        return await handler(request)
    File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
        return await handler(request)
    File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
        response = await handler(request)
    File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
        result = await handler(request, **request.match_info)
    File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
        return await func(self, request, *args, **kwargs)
    File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 262, in post
        return await super().post(request)
    File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
        return await method(view, request, data, *args, **kwargs)
    File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 77, in post
        return await self._post_impl(request, data)
    File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 84, in _post_impl
        result = await self._flow_mgr.async_init(
    File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 342, in async_init
        result = await self._async_handle_step(flow, flow.init_step, data)
    File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 517, in _async_handle_step
        result: _FlowResultT = await getattr(flow, method)(user_input)
    File "/config/custom_components/tuya_ble/config_flow.py", line 165, in async_step_init
        return await self.async_step_login(user_input)
    File "/config/custom_components/tuya_ble/config_flow.py", line 204, in async_step_login
        return _show_login_form(self, user_input, errors, placeholders)
    File "/config/custom_components/tuya_ble/config_flow.py", line 117, in _show_login_form
        def_country = pycountry.countries.get(alpha_2=flow.hass.config.country)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant