René's URL Explorer Experiment


Title: Normalize lone CR to LF in str source for `exec()`, `eval()` and `-c` by Copilot · Pull Request #9762 · RustPython/RustPython · GitHub

Open Graph Title: Normalize lone CR to LF in str source for `exec()`, `eval()` and `-c` by Copilot · Pull Request #9762 · RustPython/RustPython

X Title: Normalize lone CR to LF in str source for `exec()`, `eval()` and `-c` by Copilot · Pull Request #9762 · RustPython/RustPython

Description: When source is passed to exec() or eval() as a str, or via -c, a lone \r inside a string literal stays '\r'. CPython reads it as '\n', as it does for CRLF. The language reference says line-ending sequences are replaced by LF "even inside string literals". Docstrings with CR-only breaks also went uncleaned, and exec(text) differed from exec(text.encode()). These paths skip the source decoder and reach compile_with_syntax_warning_handler, which only replaced "\r\n". The parser copies literal text from the source as is, so an unnormalized CR ended up in the value. crates/compiler/src/lib.rs: compile_with_syntax_warning_handler now also replaces any remaining \r with \n, after the CRLF replacement. eval('"""a\rb"""') # before: 'a\rb' after: 'a\nb' The #[cfg(windows)] \r\n replacement near line 2082 is untouched. No regression test is added. Fixes #9761

Open Graph Description: When source is passed to exec() or eval() as a str, or via -c, a lone \r inside a string literal stays '\r'. CPython reads it as '\n', as it does for CRLF. The language reference sa...

X Description: When source is passed to exec() or eval() as a str, or via -c, a lone \r inside a string literal stays '\r'. CPython reads it as '\n', as it does for CRLF. The langu...

Opengraph URL: https://github.com/RustPython/RustPython/pull/9762

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:5c61f08e-7ed7-9f70-3658-aa0b424e3ad8
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9BC2:27D3AD:34FDB78:434C1F5:6B01DE93
html-safe-nonce3c7b9708ec538a1133fd9554140a02784fde45ebfc06119fb3e28478c58fe94b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkMyOjI3RDNBRDozNEZEQjc4OjQzNEMxRjU6NkIwMURFOTMiLCJ2aXNpdG9yX2lkIjoiNzk0MzQ1MzA0OTc5NDcxNTI4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac74b39b1232c418fa8bd2c6442b9cb3a4471caade29c2e74d583be751dea883bd
hovercard-subject-tagpull_request:5223690376
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/RustPython/RustPython/pull/9762/files
twitter:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
og:image:altWhen source is passed to exec() or eval() as a str, or via -c, a lone \r inside a string literal stays '\r'. CPython reads it as '\n', as it does for CRLF. The language reference sa...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
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-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/9762/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F9762%2Ffiles
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%2FRustPython%2FRustPython%2Fpull%2F9762%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/9762/files
Reloadhttps://github.com/RustPython/RustPython/pull/9762/files
Reloadhttps://github.com/RustPython/RustPython/pull/9762/files
RustPythonhttps://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Codehttps://github.com/RustPython/RustPython
Issues195 (195)https://github.com/RustPython/RustPython/issues
Pull requests133 (133)https://github.com/RustPython/RustPython/pulls
Discussionshttps://github.com/RustPython/RustPython/discussions
Actionshttps://github.com/RustPython/RustPython/actions
Projectshttps://github.com/RustPython/RustPython/projects
Wikihttps://github.com/RustPython/RustPython/wiki
Security and qualityhttps://github.com/RustPython/RustPython/security
Insightshttps://github.com/RustPython/RustPython/insights
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
Copilothttps://github.com/apps/copilot-swe-agent
mainhttps://github.com/RustPython/RustPython/tree/main
copilot/fix-cr-in-string-literalshttps://github.com/RustPython/RustPython/tree/copilot/fix-cr-in-string-literals
Conversation 1 https://github.com/RustPython/RustPython/pull/9762
Commits 2 https://github.com/RustPython/RustPython/pull/9762/commits
Checks 30 https://github.com/RustPython/RustPython/pull/9762/checks
Files changed https://github.com/RustPython/RustPython/pull/9762/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9762/files
Normalize lone CR to LF in str source for exec(), eval() and -c https://github.com/RustPython/RustPython/pull/9762/files#top
Show all changes 2 commits https://github.com/RustPython/RustPython/pull/9762/files
7cefeaa Initial plan Copilot Nov 9, 2026 https://github.com/RustPython/RustPython/pull/9762/commits/7cefeaa9e1b86065904cb435f990e59b204a1b72
ee0b027 Apply remaining changes Copilot Nov 9, 2026 https://github.com/RustPython/RustPython/pull/9762/commits/ee0b027a36e2224787db881d336b919d5df4d9a7
Clear filters https://github.com/RustPython/RustPython/pull/9762/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9762/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9762/files
crates/compiler/src/lib.rshttps://github.com/RustPython/RustPython/pull/9762/files#diff-560e1ff98a1fe1161356b6c726aeb89f8c5e9764ccd2f4fb4dfa7143508d09e7
View file https://github.com/RustPython/RustPython/blob/ee0b027a36e2224787db881d336b919d5df4d9a7/crates/compiler/src/lib.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/9762/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/9762/files#diff-560e1ff98a1fe1161356b6c726aeb89f8c5e9764ccd2f4fb4dfa7143508d09e7
https://github.com/RustPython/RustPython/pull/9762/files#diff-560e1ff98a1fe1161356b6c726aeb89f8c5e9764ccd2f4fb4dfa7143508d09e7
Please reload this pagehttps://github.com/RustPython/RustPython/pull/9762/files
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.