René's URL Explorer Experiment


Title: Issue · GitHub

Open Graph Title: Issue · googleapis/python-api-core

X Title: Issue · googleapis/python-api-core

Description: This library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-api-core - Issue · googleapis/python-api-core

Open Graph Description: This library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-api-core - Issue · googleapis/python-api-core

X Description: This library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-api-core - Issue · googleapis/python-api-core

Opengraph URL: https://github.com/googleapis/python-api-core

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Exception chain lost when retry mechanism re-raises non-retryable errors","articleBody":"#### Environment details\n\n  - OS type and version: macOS 26.1\n  - Python version: 3.12.12\n  - pip version: 25.3\n  - `google-api-core` version: HEAD = [f8bf6f9610f3e0e7580f223794c3906513e1fa73](https://github.com/googleapis/python-api-core/commit/f8bf6f9610f3e0e7580f223794c3906513e1fa73)\n\n#### Description\n\nThe retry mechanism clears the `__cause__` attribute when re-raising non-retryable exceptions, breaking explicit exception chaining created with `raise ... from ...`.\n\n#### Steps to reproduce\n\n  1. Use the `@retry_async.AsyncRetry` decorator\n  2. Raise a non-retryable exception with a cause\n  3. Catch the exception and try to read or log its cause\n\n#### Code example\n\n```python\nimport asyncio\nfrom google.api_core import retry_async, exceptions\n\n@retry_async.AsyncRetry(predicate=retry_async.if_exception_type(exceptions.InternalServerError))\nasync def example():\n    try:\n        raise exceptions.Unauthenticated(\"Invalid credentials\")\n    except exceptions.Unauthenticated as exc:\n        raise ValueError(\"Access denied\") from exc  # Explicit chaining\n\nasync def main():\n    # After going through retry:\n    try:\n        await example()\n    except ValueError as e:\n        print(e.__cause__)  # Expected: \"401 Invalid credentials\"; Actual: None\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\nSee https://github.com/googleapis/python-api-core/pull/879/changes for a unit test that fails with the current code and passes with the proposed fix.\n\n#### Root Cause\n\nIn [retry_base.py:168](https://github.com/googleapis/python-api-core/blob/f8bf6f9610f3e0e7580f223794c3906513e1fa73/google/api_core/retry/retry_base.py#L168), `_default_exception_factory()` returns `(exc_list[-1], None)`, which causes raise `final_exc` from `None` on line 214, explicitly clearing `__cause__`.\n\n#### Proposed fix\n\nPreserve the exception's __cause__ attribute:\n\n```python\n# Before\nreturn exc_list[-1], None\n\n# After\nfinal_exc = exc_list[-1]\ncause = getattr(final_exc, '__cause__', None)\nreturn final_exc, cause\n```\n\nThis maintains exception chains for better debugging and meets developer expectations for exception handling.\n\n#### Draft pull request\n\nhttps://github.com/googleapis/python-api-core/pull/879","author":{"url":"https://github.com/fercor-cisco","@type":"Person","name":"fercor-cisco"},"datePublished":"2025-12-20T01:30:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/880/python-api-core/issues/880"}

route-pattern/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:0d24dda6-2762-fa9f-0db6-e6fe8f38e118
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id91D4:1BDC7:10361EA:16A2F73:6A4DF214
html-safe-nonce31217f0ed35b2bc24def04ae7b4a619e810bb5074d8ced6acaa7ff49db1ec9c8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUQ0OjFCREM3OjEwMzYxRUE6MTZBMkY3Mzo2QTRERjIxNCIsInZpc2l0b3JfaWQiOiI4OTIzMDgyOTEwNDQyODQ0NjkyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3f7839116ceeb02b2db57b7b0ce01f0ff3df37c3da4e74c6f28d61827103bebb
hovercard-subject-tagrepository:226992456
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/googleapis/python-api-core/issues/880
twitter:imagehttps://opengraph.githubassets.com/3ffccb136b2931a1a317ea19b17623cccd16bd4d2b36ea24bc2be65889f865e9/googleapis/python-api-core
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3ffccb136b2931a1a317ea19b17623cccd16bd4d2b36ea24bc2be65889f865e9/googleapis/python-api-core
og:image:altThis library has moved to https://github.com/googleapis/google-cloud-python/tree/main/packages/google-api-core - Issue · googleapis/python-api-core
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5818716c93c6a2925b815402541a32814e43a7b1261c322b0c2df75224289566
turbo-cache-controlno-cache
go-importgithub.com/googleapis/python-api-core git https://github.com/googleapis/python-api-core.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id226992456
octolytics-dimension-repository_nwogoogleapis/python-api-core
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id226992456
octolytics-dimension-repository_network_root_nwogoogleapis/python-api-core
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef4bb89367ca678f057d79b1abc45d6675b1bd5b2
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/python-api-core/issues/880#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-api-core%2Fissues%2F880
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-api-core%2Fissues%2F880
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fissues%2Fshow&source=header-repo&source_repo=googleapis%2Fpython-api-core
Reloadhttps://github.com/googleapis/python-api-core/issues/880
Reloadhttps://github.com/googleapis/python-api-core/issues/880
Reloadhttps://github.com/googleapis/python-api-core/issues/880
Please reload this pagehttps://github.com/googleapis/python-api-core/issues/880
googleapis https://github.com/googleapis
python-api-corehttps://github.com/googleapis/python-api-core
Notifications https://github.com/login?return_to=%2Fgoogleapis%2Fpython-api-core
Fork 97 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-api-core
Star 144 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-api-core
Code https://github.com/googleapis/python-api-core
Issues 0 https://github.com/googleapis/python-api-core/issues
Pull requests 0 https://github.com/googleapis/python-api-core/pulls
Actions https://github.com/googleapis/python-api-core/actions
Projects https://github.com/googleapis/python-api-core/projects
Security and quality 0 https://github.com/googleapis/python-api-core/security
Insights https://github.com/googleapis/python-api-core/pulse
Code https://github.com/googleapis/python-api-core
Issues https://github.com/googleapis/python-api-core/issues
Pull requests https://github.com/googleapis/python-api-core/pulls
Actions https://github.com/googleapis/python-api-core/actions
Projects https://github.com/googleapis/python-api-core/projects
Security and quality https://github.com/googleapis/python-api-core/security
Insights https://github.com/googleapis/python-api-core/pulse
#879https://github.com/googleapis/python-api-core/pull/879
Exception chain lost when retry mechanism re-raises non-retryable errorshttps://github.com/googleapis/python-api-core/issues/880#top
#879https://github.com/googleapis/python-api-core/pull/879
https://github.com/ohmayr
https://github.com/fercor-cisco
fercor-ciscohttps://github.com/fercor-cisco
on Dec 20, 2025https://github.com/googleapis/python-api-core/issues/880#issue-3749372225
f8bf6f9610f3e0e7580f223794c3906513e1fa73https://github.com/googleapis/python-api-core/commit/f8bf6f9610f3e0e7580f223794c3906513e1fa73
https://github.com/googleapis/python-api-core/pull/879/changeshttps://github.com/googleapis/python-api-core/pull/879/changes
retry_base.py:168https://github.com/googleapis/python-api-core/blob/f8bf6f9610f3e0e7580f223794c3906513e1fa73/google/api_core/retry/retry_base.py#L168
#879https://github.com/googleapis/python-api-core/pull/879
ohmayrhttps://github.com/ohmayr
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.