René's URL Explorer Experiment


Title: `f(**d)` rejects str keys containing lone surrogates: TypeError: keywords must be strings · Issue #8228 · RustPython/RustPython · GitHub

Open Graph Title: `f(**d)` rejects str keys containing lone surrogates: TypeError: keywords must be strings · Issue #8228 · RustPython/RustPython

X Title: `f(**d)` rejects str keys containing lone surrogates: TypeError: keywords must be strings · Issue #8228 · RustPython/RustPython

Description: Summary Unpacking a dict whose keys contain lone surrogates via ** raises TypeError: keywords must be strings, but the keys are str instances. CPython accepts any str key through the ** call path. def collect(**kw): return kw collect(**{...

Open Graph Description: Summary Unpacking a dict whose keys contain lone surrogates via ** raises TypeError: keywords must be strings, but the keys are str instances. CPython accepts any str key through the ** call path. ...

X Description: Summary Unpacking a dict whose keys contain lone surrogates via ** raises TypeError: keywords must be strings, but the keys are str instances. CPython accepts any str key through the ** call path. ...

Opengraph URL: https://github.com/RustPython/RustPython/issues/8228

X: @github

direct link

Domain: Github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`f(**d)` rejects str keys containing lone surrogates: TypeError: keywords must be strings","articleBody":"# Summary\n\nUnpacking a dict whose keys contain lone surrogates via `**` raises `TypeError: keywords must be strings`, but the keys *are* `str` instances. CPython accepts any `str` key through the `**` call path.\n\n```python\ndef collect(**kw):\n    return kw\n\ncollect(**{'\\udc81': 2})     # TypeError: keywords must be strings\ndict(**{'\\udc81': 1})        # TypeError: keywords must be strings\n```\n\nCPython 3.14.2:\n\n```\n\u003e\u003e\u003e collect(**{'\\udc81': 2})\n{'\\udc81': 2}\n```\n\n`'\\udc81'` is a real `str` (e.g. produced by `os.fsdecode` of undecodable bytes, `surrogateescape`-decoded data, etc.), so this rejects valid programs. Verified on `main` @ 7044fdcc8.\n\n# Cause\n\n`ExecutingFrame::collect_ex_args` (`crates/vm/src/frame.rs:6539`) validates kwargs keys with\n\n```rust\nkey.downcast_ref::\u003cPyUtf8Str\u003e()\n    .ok_or_else(|| vm.new_type_error(\"keywords must be strings\"))?;\n```\n\nA str containing a lone surrogate is a `PyStr` whose payload is Wtf8, not `PyUtf8Str`, so the downcast fails even though the key is a `str`. The same pattern exists at `frame.rs:6521`, `crates/vm/src/stdlib/_functools.rs` (partial), and `crates/capi/src/abstract_.rs`.\n\nThe deeper constraint is that `KwArgs`/`FuncArgs` keyword names are Rust `String` (UTF-8), so a surrogate-carrying key currently has no representation in the calling convention; fixing this properly means keyword names need to be `Wtf8Buf` (or `PyStrRef`) end-to-end. The error message check should be `downcast_ref::\u003cPyStr\u003e()` (matching CPython, which only rejects non-`str` keys) once the storage can hold it.\n\n---\n*Found while running synthetic benchmark/compat suites; researched and reported by Claude on behalf of @youknowone.*\n","author":{"url":"https://github.com/youknowone","@type":"Person","name":"youknowone"},"datePublished":"2026-07-06T15:34:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/8228/RustPython/issues/8228"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:28036b9b-5eb1-e226-d842-1c52fdcf0c86
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9B70:D629A:8B6B:C82F:6A61F62F
html-safe-nonce79c9215b47374795f810302bd097b1e49f14d3cafb0faf8465604dcdd1cd36b1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QjcwOkQ2MjlBOjhCNkI6QzgyRjo2QTYxRjYyRiIsInZpc2l0b3JfaWQiOiIyMDQ2NzQ2Mjk1NjYzNzE5OTgzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac87d1be2ed45d6e48f7e12aa36961d1f5cb3c4da14c708241cfb7a97b11f5fc95
hovercard-subject-tagissue:4820663945
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/RustPython/RustPython/8228/issue_layout
twitter:imagehttps://opengraph.githubassets.com/58ef520c3910a00b4b3ea903eac42e22bb008453f534f84f23a87c27dfd6c7cf/RustPython/RustPython/issues/8228
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/58ef520c3910a00b4b3ea903eac42e22bb008453f534f84f23a87c27dfd6c7cf/RustPython/RustPython/issues/8228
og:image:altSummary Unpacking a dict whose keys contain lone surrogates via ** raises TypeError: keywords must be strings, but the keys are str instances. CPython accepts any str key through the ** call path. ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameyouknowone
hostnamegithub.com
expected-hostnamegithub.com
Noned88d9dd41cd32712dc23ff01ba406271c88c4858198430c255d591be42a1166f
turbo-cache-controlno-preview
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
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
releasea7f024eda6b8ce06d29c9276168423bfe05bafae
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://Github.com/RustPython/RustPython/issues/8228#start-of-content
https://Github.com/
Sign in https://Github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fissues%2F8228
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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/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/enterprise/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%2FRustPython%2FRustPython%2Fissues%2F8228
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=RustPython%2FRustPython
Reloadhttps://Github.com/RustPython/RustPython/issues/8228
Reloadhttps://Github.com/RustPython/RustPython/issues/8228
Reloadhttps://Github.com/RustPython/RustPython/issues/8228
Please reload this pagehttps://Github.com/RustPython/RustPython/issues/8228
RustPython https://Github.com/RustPython
RustPythonhttps://Github.com/RustPython/RustPython
Notifications https://Github.com/login?return_to=%2FRustPython%2FRustPython
Fork 1.5k https://Github.com/login?return_to=%2FRustPython%2FRustPython
Star 22.2k https://Github.com/login?return_to=%2FRustPython%2FRustPython
Code https://Github.com/RustPython/RustPython
Issues 294 https://Github.com/RustPython/RustPython/issues
Pull requests 105 https://Github.com/RustPython/RustPython/pulls
Discussions https://Github.com/RustPython/RustPython/discussions
Actions https://Github.com/RustPython/RustPython/actions
Projects https://Github.com/RustPython/RustPython/projects
Models https://Github.com/RustPython/RustPython/models
Wiki https://Github.com/RustPython/RustPython/wiki
Security and quality 0 https://Github.com/RustPython/RustPython/security
Insights https://Github.com/RustPython/RustPython/pulse
Code https://Github.com/RustPython/RustPython
Issues https://Github.com/RustPython/RustPython/issues
Pull requests https://Github.com/RustPython/RustPython/pulls
Discussions https://Github.com/RustPython/RustPython/discussions
Actions https://Github.com/RustPython/RustPython/actions
Projects https://Github.com/RustPython/RustPython/projects
Models https://Github.com/RustPython/RustPython/models
Wiki https://Github.com/RustPython/RustPython/wiki
Security and quality https://Github.com/RustPython/RustPython/security
Insights https://Github.com/RustPython/RustPython/pulse
f(**d) rejects str keys containing lone surrogates: TypeError: keywords must be stringshttps://Github.com/RustPython/RustPython/issues/8228#top
https://Github.com/HyoJongPark
https://github.com/youknowone
youknowonehttps://github.com/youknowone
on Jul 6, 2026https://github.com/RustPython/RustPython/issues/8228#issue-4820663945
7044fdchttps://github.com/RustPython/RustPython/commit/7044fdcc86b182885a4c7def474bba0d0623cd30
@youknowonehttps://github.com/youknowone
HyoJongParkhttps://Github.com/HyoJongPark
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.