René's URL Explorer Experiment


Title: sync_and_async_middleware throws exception · Issue #1014 · getsentry/sentry-python · GitHub

Open Graph Title: sync_and_async_middleware throws exception · Issue #1014 · getsentry/sentry-python

X Title: sync_and_async_middleware throws exception · Issue #1014 · getsentry/sentry-python

Description: Which SDK and version? sentry_sdk==0.20.0 uvicorn==0.13.3 gunicorn==20.0.4 django==3.1.6 Steps to Reproduce copy the middleware example from django docs: import asyncio from django.utils.decorators import sync_and_async_middleware @sync_...

Open Graph Description: Which SDK and version? sentry_sdk==0.20.0 uvicorn==0.13.3 gunicorn==20.0.4 django==3.1.6 Steps to Reproduce copy the middleware example from django docs: import asyncio from django.utils.decorators...

X Description: Which SDK and version? sentry_sdk==0.20.0 uvicorn==0.13.3 gunicorn==20.0.4 django==3.1.6 Steps to Reproduce copy the middleware example from django docs: import asyncio from django.utils.decorators...

Opengraph URL: https://github.com/getsentry/sentry-python/issues/1014

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"sync_and_async_middleware throws exception","articleBody":"Which SDK and version?\r\nsentry_sdk==0.20.0\r\nuvicorn==0.13.3\r\ngunicorn==20.0.4\r\ndjango==3.1.6\r\n\r\n### Steps to Reproduce\r\n\r\ncopy the middleware example from django [docs](https://docs.djangoproject.com/en/dev/topics/http/middleware/#asynchronous-support):\r\n```\r\nimport asyncio\r\nfrom django.utils.decorators import sync_and_async_middleware\r\n\r\n@sync_and_async_middleware\r\ndef simple_middleware(get_response):\r\n    # One-time configuration and initialization goes here.\r\n    if asyncio.iscoroutinefunction(get_response):\r\n        async def middleware(request):\r\n            # Do something here!\r\n            response = await get_response(request)\r\n            return response\r\n\r\n    else:\r\n        def middleware(request):\r\n            # Do something here!\r\n            response = get_response(request)\r\n            return response\r\n\r\n    return middleware\r\n```\r\nRun django async\r\n```\r\nuvicorn.run(\r\n        \"apps.asgi:application\",\r\n        host=\"0.0.0.0\", port=8000, lifespan='off', loop='asyncio', reload=True,\r\n        ...\r\n    )\r\n```\r\n\r\n### Actual Result\r\n```\r\n...\r\nFile \"/usr/local/lib/python3.8/dist-packages/sentry_sdk/integrations/django/asgi.py\r\nException Value: 'function' object has no attribute '__acall__'\r\n```\r\n\r\nThe problem is, that the decorator style has no `__acall__` and the middleware is a function (not a class)\r\n\r\nNo problems in 0.19.x\r\nThis bug was introduced with this PR https://github.com/getsentry/sentry-python/pull/992","author":{"url":"https://github.com/Speedy1991","@type":"Person","name":"Speedy1991"},"datePublished":"2021-02-12T10:17:56Z","url":"https://github.com/getsentry/sentry-python/issues/1014"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:15d9c9c7-fb79-e189-55f2-83d7e0adf4ab
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDFB8:164BEE:367E23:4983F2:6B00899B
html-safe-nonce1c722b2977ccbb581eccd32fa76b576ad32b3dd28b4d9f8da3f2095d0028ce63
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERkI4OjE2NEJFRTozNjdFMjM6NDk4M0YyOjZCMDA4OTlCIiwidmlzaXRvcl9pZCI6IjIzMTc0NDAzMDMxNzYzODY5NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace5df2fbc06f4d3274c93b265b855339b03897e563a374aae9eefae1990ebf15b
hovercard-subject-tagissue:807112864
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-python/1014/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1856d09007888220ecb3189b213f148f796945554c6b6329d706a34097f2e54b/getsentry/sentry-python/issues/1014
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1856d09007888220ecb3189b213f148f796945554c6b6329d706a34097f2e54b/getsentry/sentry-python/issues/1014
og:image:altWhich SDK and version? sentry_sdk==0.20.0 uvicorn==0.13.3 gunicorn==20.0.4 django==3.1.6 Steps to Reproduce copy the middleware example from django docs: import asyncio from django.utils.decorators...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameSpeedy1991
hostnamegithub.com
expected-hostnamegithub.com
None4d3d8e50f02c1d7bf86d5acfa1d3bfe9366abd6528a6b429eb07a168429d2b61
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-python git https://github.com/getsentry/sentry-python.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id137814779
octolytics-dimension-repository_nwogetsentry/sentry-python
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id137814779
octolytics-dimension-repository_network_root_nwogetsentry/sentry-python
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
releasedb758f8e02b8257935fb03edf81a3e76eb3abd11
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-python/issues/1014#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F1014
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-python%2Fissues%2F1014
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-python
Reloadhttps://github.com/getsentry/sentry-python/issues/1014
Reloadhttps://github.com/getsentry/sentry-python/issues/1014
Reloadhttps://github.com/getsentry/sentry-python/issues/1014
getsentryhttps://github.com/getsentry
sentry-pythonhttps://github.com/getsentry/sentry-python
Codehttps://github.com/getsentry/sentry-python
Issues345 (345)https://github.com/getsentry/sentry-python/issues
Pull requests41 (41)https://github.com/getsentry/sentry-python/pulls
Discussionshttps://github.com/getsentry/sentry-python/discussions
Actionshttps://github.com/getsentry/sentry-python/actions
Security and quality2 (2)https://github.com/getsentry/sentry-python/security
Insightshttps://github.com/getsentry/sentry-python/insights
https://github.com/getsentry/sentry-python
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/1014
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/1014
#1016https://github.com/getsentry/sentry-python/pull/1016
sync_and_async_middleware throws exceptionhttps://github.com/getsentry/sentry-python/issues/1014#top
#1016https://github.com/getsentry/sentry-python/pull/1016
https://github.com/ahmedetefy
https://github.com/Speedy1991
Speedy1991https://github.com/Speedy1991
on Feb 12, 2021https://github.com/getsentry/sentry-python/issues/1014#issue-807112864
docshttps://docs.djangoproject.com/en/dev/topics/http/middleware/#asynchronous-support
#992https://github.com/getsentry/sentry-python/pull/992
untitakerhttps://github.com/untitaker
ahmedetefyhttps://github.com/ahmedetefy
on Feb 12, 2021https://github.com/getsentry/sentry-python/issues/1014#event-4324419340
https://github.com/ahmedetefy
ahmedetefyhttps://github.com/ahmedetefy
on Feb 12, 2021https://github.com/getsentry/sentry-python/issues/1014#issuecomment-778151670
@Speedy1991https://github.com/Speedy1991
ahmedetefyhttps://github.com/ahmedetefy
completedhttps://github.com/getsentry/sentry-python/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#1016https://github.com/getsentry/sentry-python/pull/1016
on Feb 12, 2021https://github.com/getsentry/sentry-python/issues/1014#event-4324755789
https://github.com/Speedy1991
Speedy1991https://github.com/Speedy1991
on Feb 12, 2021https://github.com/getsentry/sentry-python/issues/1014#issuecomment-778214953
https://github.com/ahmedetefy
ahmedetefyhttps://github.com/ahmedetefy
on Feb 12, 2021https://github.com/getsentry/sentry-python/issues/1014#issuecomment-778312005
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-python/issues/1014
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-python/issues/1014
ahmedetefyhttps://github.com/ahmedetefy
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.