René's URL Explorer Experiment


Title: Messed plugin config list order · Issue #677 · python-lsp/python-lsp-server · GitHub

Open Graph Title: Messed plugin config list order · Issue #677 · python-lsp/python-lsp-server

X Title: Messed plugin config list order · Issue #677 · python-lsp/python-lsp-server

Description: Hi! TL;DR I think that merge_dicts implementation in _utils.py is wrong: def merge_dicts(dict_a, dict_b): """Recursively merge dictionary b into dictionary a. If override_nones is True, then """ def _merge_dicts_(a, b): for key in set(a....

Open Graph Description: Hi! TL;DR I think that merge_dicts implementation in _utils.py is wrong: def merge_dicts(dict_a, dict_b): """Recursively merge dictionary b into dictionary a. If override_nones is True, then """ de...

X Description: Hi! TL;DR I think that merge_dicts implementation in _utils.py is wrong: def merge_dicts(dict_a, dict_b): """Recursively merge dictionary b into dictionary a. If override_nones is Tr...

Opengraph URL: https://github.com/python-lsp/python-lsp-server/issues/677

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Messed plugin config list order","articleBody":"Hi!\n\n**TL;DR**\n\nI think that merge_dicts implementation in `_utils.py` is wrong:\n\n```py\ndef merge_dicts(dict_a, dict_b):\n    \"\"\"Recursively merge dictionary b into dictionary a.\n\n    If override_nones is True, then\n    \"\"\"\n\n    def _merge_dicts_(a, b):\n        for key in set(a.keys()).union(b.keys()):\n            if key in a and key in b:\n                if isinstance(a[key], dict) and isinstance(b[key], dict):\n                    yield (key, dict(_merge_dicts_(a[key], b[key])))\n                elif isinstance(a[key], list) and isinstance(b[key], list):\n                    yield (key, list(set(a[key] + b[key]))) # \u003c--- this line here is wrong\n                elif b[key] is not None:\n                    yield (key, b[key])\n                else:\n                    yield (key, a[key])\n            elif key in a:\n                yield (key, a[key])\n            elif b[key] is not None:\n                yield (key, b[key])\n\n    return dict(_merge_dicts_(dict_a, dict_b))\n```\n\nBy converting the list to a set, it not only gets rid of the duplicates, but also messes up the list order unpredictably. Replacing `set()` with `OrderedDict.fromkeys()` seems to fix the issue described in detail below.\n\n----\n\nI'm using pylsp v1.13.1 with pylsp_mypy v0.7.0. (The whole LSP is run by Emacs v30.1 via eglot, but this probably doesn't matter.) And I noticed the following strange behavior, which I can't really put my finger on yet.\n\nWhen pylsp invokes pylsp_mypy, it uses the following configuration:\n\n```\n[stderr]  2025-10-08 12:21:46,942 CEST - INFO - pylsp.config.config - Updated settings to {'plugins': {'jedi': {'environment': '/home/david/pyproj/.venv'}, 'ruff': {'executable': '/home/david/pyproj/.venv/bin/ruff'}, 'pylsp_mypy': {'overrides': ['--python-executable', '/home/david/pyproj/.venv/bin/python', True]}, 'flake8': {'executable': None}, 'pylint': {'executable': None}}}\n```\n\nNote the `overrides` list. The next log line after this, however, is this:\n\n```\n[stderr]  2025-10-08 12:21:47,475 CEST - INFO - pylsp_mypy.plugin - lint settings = {'overrides': [True, '/home/david/pyproj/.venv/bin/python', '--python-executable']} document.path = /home/david/pyproj/src/pyproj/__init__.py is_saved = False\n```\n\nNote how the `overrides` list is in reverse order. And right enough, mypy refuses to run:\n\n```\nerror: argument --python-executable: expected one **argument**\n```\n\nI also noticed that it's not always reverse, the order seems to be pretty random. Sometimes it's ok and works, other times, it's messed up.","author":{"url":"https://github.com/dhanak","@type":"Person","name":"dhanak"},"datePublished":"2025-10-08T10:51:16.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/677/python-lsp-server/issues/677"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:52cba5d9-7c0e-7b51-f176-85173c133cd0
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8292:A2119:20604E1:2BEE0D8:6970861F
html-safe-nonce7f7a2e11cfa65b6c6ec897f6440f833cb686ea21f7ffb99b918cc26e01a0f6f6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjkyOkEyMTE5OjIwNjA0RTE6MkJFRTBEODo2OTcwODYxRiIsInZpc2l0b3JfaWQiOiI2MjY3Njc5NzExMzU4Mzg3NzQzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac41e21f6cf28981547b90f4973e22e783a8e5aa61e676433034f4ec32bad1257e
hovercard-subject-tagissue:3494920635
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-lsp/python-lsp-server/677/issue_layout
twitter:imagehttps://opengraph.githubassets.com/382f1c55a6424df154e4ae73d4127723cdd5de76c96dbeac1cc2d7ab345411a9/python-lsp/python-lsp-server/issues/677
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/382f1c55a6424df154e4ae73d4127723cdd5de76c96dbeac1cc2d7ab345411a9/python-lsp/python-lsp-server/issues/677
og:image:altHi! TL;DR I think that merge_dicts implementation in _utils.py is wrong: def merge_dicts(dict_a, dict_b): """Recursively merge dictionary b into dictionary a. If override_nones is True, then """ de...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedhanak
hostnamegithub.com
expected-hostnamegithub.com
None9920a62ba22d06470388e2904804fb7e5ec51c9e35f81784e9191394c74b2bd2
turbo-cache-controlno-preview
go-importgithub.com/python-lsp/python-lsp-server git https://github.com/python-lsp/python-lsp-server.git
octolytics-dimension-user_id51609341
octolytics-dimension-user_loginpython-lsp
octolytics-dimension-repository_id341006790
octolytics-dimension-repository_nwopython-lsp/python-lsp-server
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id341006790
octolytics-dimension-repository_network_root_nwopython-lsp/python-lsp-server
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
release7d6181066430cc06553c8396ca201e194ae33cb9
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/issues/677#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-lsp%2Fpython-lsp-server%2Fissues%2F677
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://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-lsp%2Fpython-lsp-server%2Fissues%2F677
Sign up https://patch-diff.githubusercontent.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-lsp%2Fpython-lsp-server
Reloadhttps://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/issues/677
Reloadhttps://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/issues/677
Reloadhttps://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/issues/677
python-lsp https://patch-diff.githubusercontent.com/python-lsp
python-lsp-serverhttps://patch-diff.githubusercontent.com/python-lsp/python-lsp-server
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-lsp%2Fpython-lsp-server
Fork 230 https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-lsp%2Fpython-lsp-server
Star 2.5k https://patch-diff.githubusercontent.com/login?return_to=%2Fpython-lsp%2Fpython-lsp-server
Code https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server
Issues 144 https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/issues
Pull requests 21 https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/pulls
Discussions https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/discussions
Actions https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/actions
Projects 0 https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/projects
Security Uh oh! There was an error while loading. Please reload this page. https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/security
Please reload this pagehttps://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/issues/677
Insights https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/pulse
Code https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server
Issues https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/issues
Pull requests https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/pulls
Discussions https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/discussions
Actions https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/actions
Projects https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/projects
Security https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/security
Insights https://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/python-lsp/python-lsp-server/issues/677
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/python-lsp/python-lsp-server/issues/677
Messed plugin config list orderhttps://patch-diff.githubusercontent.com/python-lsp/python-lsp-server/issues/677#top
https://github.com/dhanak
https://github.com/dhanak
dhanakhttps://github.com/dhanak
on Oct 8, 2025https://github.com/python-lsp/python-lsp-server/issues/677#issue-3494920635
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.