{"id":24821,"library":"wait-for","title":"wait-for","description":"A waiting utility with decorator and logger support, providing configurable retries, timeouts, and custom conditions. Current version 1.2.0. Release cadence: irregular (last release Oct 2020). Supports Python >=3.6.","status":"active","version":"1.2.0","language":"python","source_language":"en","source_url":"https://github.com/RedHatQE/wait_for","tags":["waiting","retry","decorator","timeout","utility"],"install":[{"cmd":"pip install wait-for","lang":"bash","label":"Standard install"}],"dependencies":[],"imports":[{"note":"Common mistake is to import 'wait' or 'wait_for' from other libraries like 'tenacity'.","wrong":"","symbol":"wait_for","correct":"from wait_for import wait_for"},{"note":"Import TimedOutError for timeouts.","wrong":"","symbol":"TimedOutError","correct":"from wait_for import TimedOutError"}],"quickstart":{"code":"from wait_for import wait_for\nimport time\n\ndef check_condition():\n    # Replace with actual condition logic\n    return False\n\ntry:\n    result, elapsed = wait_for(check_condition, timeout=10, delay=1)\n    print('Success', result, elapsed)\nexcept Exception as e:\n    print('Failed:', e)","lang":"python","description":"Waits for a condition to be true, retrying every `delay` seconds until `timeout`. Returns (result, elapsed_time) on success, raises TimedOutError on timeout."},"warnings":[{"fix":"Set `silent_failure=True` in the call to ignore exceptions and treat them as failures.","message":"If `check_condition` raises an exception, `wait_for` retries by default (silent_failure=False). To avoid infinite retries on errors, set `silent_failure=True` or catch exceptions inside the condition.","severity":"gotcha","affected_versions":"all"},{"fix":"Always pass a number (int/float) for `delay` and `timeout`.","message":"The `num_sec` argument for `delay` is explicitly converted to `float`. Passing a string or non-numeric type will raise a `TypeError`.","severity":"gotcha","affected_versions":">=1.1.0"},{"fix":"Upgrade to Python 3.6+.","message":"Python 2.7, 3.3, and 3.4 support was dropped in version 1.1.0. Using with these versions will fail.","severity":"deprecated","affected_versions":">=1.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Update to wait-for 1.1.0+ (explicit float conversion) or ensure timeout is an integer.","cause":"Passing a float timeout value before version 1.1.0; older versions expected integer.","error":"TypeError: 'float' object cannot be interpreted as an integer"},{"fix":"Install the correct package: `pip install wait-for` (note the hyphen).","cause":"Incorrect installation or missing package (typo in package name: wait-for vs wait_for).","error":"ImportError: cannot import name 'wait_for' from 'wait_for'"},{"fix":"Pass a callable as the first argument: `wait_for(my_func, timeout=10)`.","cause":"Calling `wait_for()` without a callable (the function to wait for).","error":"wait_for() missing 1 required positional argument: 'func'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}