{"id":24382,"library":"pyramid-retry","title":"pyramid_retry","description":"An execution policy for the Pyramid web framework that supports retrying requests after certain failure exceptions. Version 2.1.1 provides integration with Pyramid's tweens to automatically retry failed requests based on configurable policies. It is maintained by the Pylons project and has a stable release cadence.","status":"active","version":"2.1.1","language":"python","source_language":"en","source_url":"https://github.com/Pylons/pyramid_retry","tags":["pyramid","retry","tween","web"],"install":[{"cmd":"pip install pyramid-retry","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"","symbol":"RetryablePolicy","correct":"from pyramid_retry import RetryablePolicy"},{"note":"","symbol":"retry_tween_factory","correct":"from pyramid_retry import retry_tween_factory"}],"quickstart":{"code":"from wsgiref.simple_server import make_server\nfrom pyramid.config import Configurator\nfrom pyramid_retry import RetryablePolicy, retry_tween_factory\n\ndef hello_world(request):\n    return {'status': 'ok'}\n\nif __name__ == '__main__':\n    with Configurator() as config:\n        config.add_route('home', '/')\n        config.add_view(hello_world, route_name='home', renderer='json')\n        # Set retry policy\n        config.add_tween('pyramid_retry.retry_tween_factory')\n        config.add_settings({\n            'retry.max_attempts': 3,\n            'retry.policies': [RetryablePolicy()],\n        })\n        app = config.make_wsgi_app()\n    server = make_server('0.0.0.0', 8080, app)\n    server.serve_forever()","lang":"python","description":"Minimal example configures retries with default policy."},"warnings":[{"fix":"Replace 'retry_max' with 'retry.max_attempts' in your Pyramid settings.","message":"pyramid_retry 2.0 removed the 'retry_max' setting. Use 'retry.max_attempts' instead.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Set 'retry.policies': [RetryablePolicy()] rather than just 'retry.policies': RetryablePolicy().","message":"Retry policies must be added as a list to 'retry.policies'. Forgetting the list wrapper causes a configuration error.","severity":"gotcha","affected_versions":"all"},{"fix":"Use config.add_tween('pyramid_retry.retry_tween_factory', under='pyramid_tm.tm_tween_factory') if pyramid_tm is active.","message":"The retry tween factory must be added after pyramid_tm if you use transaction management; ordering matters.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Upgrade pyramid-retry to >=2.0 and use 'from pyramid_retry import RetryablePolicy'.","cause":"Importing from wrong module or outdated version (<2.0). RetryablePolicy was introduced in 2.0.","error":"AttributeError: module 'pyramid_retry' has no attribute 'RetryablePolicy'"},{"fix":"Replace 'retry_max' with 'retry.max_attempts' in your config settings.","cause":"Using deprecated setting 'retry_max' instead of 'retry.max_attempts'.","error":"ConfigurationError: ('Unknown settings value: retry_max',)"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}