René's URL Explorer Experiment


Title: AttributeError: BadRRModeError object has no attribute 'sequence_number' · Issue #259 · python-xlib/python-xlib · GitHub

Open Graph Title: AttributeError: BadRRModeError object has no attribute 'sequence_number' · Issue #259 · python-xlib/python-xlib

X Title: AttributeError: BadRRModeError object has no attribute 'sequence_number' · Issue #259 · python-xlib/python-xlib

Description: Dear maintainer, tldr; An uncaught exception in parse_error_response() causes the next call to get_input_focus() to hang indefinitely with 100% CPU usage. Details OS: Debian Bookworm Python version: 3.10.9 python3-xlib version: 0.33-1 Th...

Open Graph Description: Dear maintainer, tldr; An uncaught exception in parse_error_response() causes the next call to get_input_focus() to hang indefinitely with 100% CPU usage. Details OS: Debian Bookworm Python version...

X Description: Dear maintainer, tldr; An uncaught exception in parse_error_response() causes the next call to get_input_focus() to hang indefinitely with 100% CPU usage. Details OS: Debian Bookworm Python version...

Opengraph URL: https://github.com/python-xlib/python-xlib/issues/259

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AttributeError: BadRRModeError object has no attribute 'sequence_number'","articleBody":"Dear maintainer,\r\n\r\n**tldr**; An uncaught exception in `parse_error_response()` causes the next call to `get_input_focus()` to hang indefinitely with 100% CPU usage.\r\n\r\n## Details\r\n\r\n**OS**: Debian Bookworm\r\n**Python version**: 3.10.9\r\n**python3-xlib version**: 0.33-1\r\n\r\nThe application I use calls `win.get_full_property(self._NET_WM_NAME, 0)` where `win` is instance of `Window` from `drawable.py` and `self._NET_WM_NAME` is 326.\r\n\r\nThe traceback is as follows:\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/bin/keyd-application-mapper\", line 156, in get_title\r\n    x = win.get_full_property(self._NET_WM_NAME, 0).value\r\n  File \"/usr/lib/python3/dist-packages/Xlib/xobject/drawable.py\", line 476, in get_full_property\r\n    prop = self.get_property(property, property_type, sizehint,\r\n  File \"/usr/lib/python3/dist-packages/Xlib/xobject/drawable.py\", line 455, in get_property\r\n    r = request.GetProperty(display = self.display,\r\n  File \"/usr/lib/python3/dist-packages/Xlib/protocol/rq.py\", line 1368, in __init__\r\n    self.reply()\r\n  File \"/usr/lib/python3/dist-packages/Xlib/protocol/rq.py\", line 1380, in reply\r\n    self._display.send_and_recv(request = self._serial)\r\n  File \"/usr/lib/python3/dist-packages/Xlib/protocol/display.py\", line 612, in send_and_recv\r\n    gotreq = self.parse_response(request)\r\n  File \"/usr/lib/python3/dist-packages/Xlib/protocol/display.py\", line 719, in parse_response\r\n    gotreq = self.parse_error_response(request) or gotreq\r\n  File \"/usr/lib/python3/dist-packages/Xlib/protocol/display.py\", line 745, in parse_error_response\r\n    req = self.get_waiting_request(e.sequence_number)\r\nAttributeError: 'BadRRModeError' object has no attribute 'sequence_number'\r\n```\r\n\r\nThe [`BadRRModeError`](https://github.com/python-xlib/python-xlib/commit/c87624dd6ec780417e2d32529976d65fed344045) exception was added by `disp.extension_add_error(BadRRMode, BadRRModeError)` in `Xlib/ext/randr.py` and seems to be quite different from the other errors defined in `Xlib/error.py` and in particular the '**sequence_number**' attribute does not exist.\r\n\r\nThe application I use logs this error and proceeds by calling `dpy.next_event()` and then `dpy.dpy.get_input_focus()` where  `dpy = Xlib.display.Display()`.\r\n\r\n_The last call hangs indefinitely with 100% CPU usage and seems to do so because of the previous_ `BadRRModeError`.\r\n\r\nI used Python's [faulthandler](https://docs.python.org/3/library/faulthandler.html) module to investigate where the code hangs (i.e. `python3 -X faulthandler application.py` and then sending `SIGARBT` to see where the main thread is). I did this several times and every time the thread was busy inside the `send_and_recv()` function in `Xlib/protocol/display.py`:\r\n```\r\nCurrent thread 0x00007f30fc5fe040 (most recent call first):\r\n  File \"/usr/lib/python3/dist-packages/Xlib/protocol/display.py\", line 515 in send_and_recv\r\n  File \"/usr/lib/python3/dist-packages/Xlib/protocol/rq.py\", line 1380 in reply\r\n  File \"/usr/lib/python3/dist-packages/Xlib/protocol/rq.py\", line 1368 in __init__\r\n  File \"/usr/lib/python3/dist-packages/Xlib/display.py\", line 607 in get_input_focus\r\n  File \"/usr/bin/keyd-application-mapper\", line 200 in run\r\n  File \"/usr/bin/keyd-application-mapper\", line 419 in \u003cmodule\u003e\r\n```\r\n\r\n## Workaround\r\n\r\nI'm not very familiar with python-xlib internals, so I still don't fully understand what is going on.\r\n\r\nA temporary solution for my case is to simply remove the line `disp.extension_add_error(BadRRMode, BadRRModeError)` which instead causes the error to appear as:\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/bin/keyd-application-mapper\", line 174, in get_window_info\r\n    return (cls[1], get_title(win))\r\n  File \"/usr/bin/keyd-application-mapper\", line 155, in get_title\r\n    raise err from None\r\n  File \"/usr/bin/keyd-application-mapper\", line 153, in get_title\r\n    title = win.get_full_property(self._NET_WM_NAME, 0).value.decode('utf8')\r\n  File \"/usr/lib/python3/dist-packages/Xlib/xobject/drawable.py\", line 476, in get_full_property\r\n    prop = self.get_property(property, property_type, sizehint,\r\n  File \"/usr/lib/python3/dist-packages/Xlib/xobject/drawable.py\", line 455, in get_property\r\n    r = request.GetProperty(display = self.display,\r\n  File \"/usr/lib/python3/dist-packages/Xlib/protocol/rq.py\", line 1368, in __init__\r\n    self.reply()\r\n  File \"/usr/lib/python3/dist-packages/Xlib/protocol/rq.py\", line 1388, in reply\r\n    raise self._error\r\nXlib.error.BadValue: \u003cclass 'Xlib.error.BadValue'\u003e: code = 2, resource_id = 10, sequence_number = 4818, major_opcode = 20, minor_opcode = 0\r\n```\r\nwhich does not cause `get_input_focus()` to hang.\r\n\r\n","author":{"url":"https://github.com/Penlect","@type":"Person","name":"Penlect"},"datePublished":"2023-01-13T18:03:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/259/python-xlib/issues/259"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7f1a77c3-bd55-4bde-affb-e68477a14299
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD24C:9124A:82FC07:A9DCD4:696AED74
html-safe-nonce83da185517bd534e236821b707a131ddfd5697d2d044f9f2cf27a536d164842f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjRDOjkxMjRBOjgyRkMwNzpBOURDRDQ6Njk2QUVENzQiLCJ2aXNpdG9yX2lkIjoiNDk2MjM4NTMyNTU3MzQ2NzUwOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac34595cbbe472cdf9f93ab7e466d08277d614e2b2cc07c19eca721708c3cd7bbc
hovercard-subject-tagissue:1532708686
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/python-xlib/python-xlib/259/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8f511578b2290facd4074b5d203e2c8122517f8a1f5c8aa99a2e7213c4b76a2f/python-xlib/python-xlib/issues/259
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8f511578b2290facd4074b5d203e2c8122517f8a1f5c8aa99a2e7213c4b76a2f/python-xlib/python-xlib/issues/259
og:image:altDear maintainer, tldr; An uncaught exception in parse_error_response() causes the next call to get_input_focus() to hang indefinitely with 100% CPU usage. Details OS: Debian Bookworm Python version...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamePenlect
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
turbo-cache-controlno-preview
go-importgithub.com/python-xlib/python-xlib git https://github.com/python-xlib/python-xlib.git
octolytics-dimension-user_id16151530
octolytics-dimension-user_loginpython-xlib
octolytics-dimension-repository_id47391866
octolytics-dimension-repository_nwopython-xlib/python-xlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id47391866
octolytics-dimension-repository_network_root_nwopython-xlib/python-xlib
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
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-xlib/python-xlib/issues/259#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-xlib%2Fpython-xlib%2Fissues%2F259
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
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
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
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%2Fpython-xlib%2Fpython-xlib%2Fissues%2F259
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python-xlib%2Fpython-xlib
Reloadhttps://github.com/python-xlib/python-xlib/issues/259
Reloadhttps://github.com/python-xlib/python-xlib/issues/259
Reloadhttps://github.com/python-xlib/python-xlib/issues/259
python-xlib https://github.com/python-xlib
python-xlibhttps://github.com/python-xlib/python-xlib
Notifications https://github.com/login?return_to=%2Fpython-xlib%2Fpython-xlib
Fork 112 https://github.com/login?return_to=%2Fpython-xlib%2Fpython-xlib
Star 455 https://github.com/login?return_to=%2Fpython-xlib%2Fpython-xlib
Code https://github.com/python-xlib/python-xlib
Issues 65 https://github.com/python-xlib/python-xlib/issues
Pull requests 16 https://github.com/python-xlib/python-xlib/pulls
Discussions https://github.com/python-xlib/python-xlib/discussions
Actions https://github.com/python-xlib/python-xlib/actions
Projects 0 https://github.com/python-xlib/python-xlib/projects
Wiki https://github.com/python-xlib/python-xlib/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python-xlib/python-xlib/security
Please reload this pagehttps://github.com/python-xlib/python-xlib/issues/259
Insights https://github.com/python-xlib/python-xlib/pulse
Code https://github.com/python-xlib/python-xlib
Issues https://github.com/python-xlib/python-xlib/issues
Pull requests https://github.com/python-xlib/python-xlib/pulls
Discussions https://github.com/python-xlib/python-xlib/discussions
Actions https://github.com/python-xlib/python-xlib/actions
Projects https://github.com/python-xlib/python-xlib/projects
Wiki https://github.com/python-xlib/python-xlib/wiki
Security https://github.com/python-xlib/python-xlib/security
Insights https://github.com/python-xlib/python-xlib/pulse
New issuehttps://github.com/login?return_to=https://github.com/python-xlib/python-xlib/issues/259
New issuehttps://github.com/login?return_to=https://github.com/python-xlib/python-xlib/issues/259
AttributeError: BadRRModeError object has no attribute 'sequence_number'https://github.com/python-xlib/python-xlib/issues/259#top
duplicatehttps://github.com/python-xlib/python-xlib/issues?q=state%3Aopen%20label%3A%22duplicate%22
https://github.com/Penlect
https://github.com/Penlect
Penlecthttps://github.com/Penlect
on Jan 13, 2023https://github.com/python-xlib/python-xlib/issues/259#issue-1532708686
BadRRModeErrorhttps://github.com/python-xlib/python-xlib/commit/c87624dd6ec780417e2d32529976d65fed344045
faulthandlerhttps://docs.python.org/3/library/faulthandler.html
duplicatehttps://github.com/python-xlib/python-xlib/issues?q=state%3Aopen%20label%3A%22duplicate%22
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.