Title: csv.writer: embedded \r/\n not quoted with a custom lineterminator (QUOTE_MINIMAL) · Issue #8317 · RustPython/RustPython · GitHub
Open Graph Title: csv.writer: embedded \r/\n not quoted with a custom lineterminator (QUOTE_MINIMAL) · Issue #8317 · RustPython/RustPython
X Title: csv.writer: embedded \r/\n not quoted with a custom lineterminator (QUOTE_MINIMAL) · Issue #8317 · RustPython/RustPython
Description: Feature Follow-up from #8254 (found by @doma17). With QUOTE_MINIMAL and a custom lineterminator (not CR/LF), embedded \r/\n in a field are not quoted, so the output differs from CPython. import csv, io sio = io.StringIO() csv.writer(sio,...
Open Graph Description: Feature Follow-up from #8254 (found by @doma17). With QUOTE_MINIMAL and a custom lineterminator (not CR/LF), embedded \r/\n in a field are not quoted, so the output differs from CPython. import csv...
X Description: Feature Follow-up from #8254 (found by @doma17). With QUOTE_MINIMAL and a custom lineterminator (not CR/LF), embedded \r/\n in a field are not quoted, so the output differs from CPython. import csv...
Opengraph URL: https://github.com/RustPython/RustPython/issues/8317
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"csv.writer: embedded \\r/\\n not quoted with a custom lineterminator (QUOTE_MINIMAL)","articleBody":"## Feature\n\n\u003c!-- What Python feature is missing from RustPython? Give a short description of the feature and how you ran into its absence. --\u003e\n\nFollow-up from #8254 (found by @doma17).\n\nWith `QUOTE_MINIMAL` and a custom `lineterminator` (not CR/LF), embedded `\\r`/`\\n` in a field are not quoted, so the output differs from CPython.\n\n```python\nimport csv, io\nsio = io.StringIO()\ncsv.writer(sio, lineterminator=\"!\").writerow([\"\\r\", \"\\n\"])\nprint(repr(sio.getvalue()))\n# CPython: '\"\\r\",\"\\n\"!'\n# RustPython: '\\r,\\n!'\n```\n\nCPython always quotes fields containing `\\r`/`\\n` regardless of the lineterminator. (Not a regression from #8254 — same on `develop`.)\n\n## Python Documentation or reference to CPython source code\n\n\u003c!-- Give a link to the feature in the CPython documentation (https://docs.python.org/3/) in order to assist in its implementation. --\u003e\n\nhttps://docs.python.org/3/library/csv.html#csv.QUOTE_MINIMAL\n\n---\n_Re-created from #8302, which was closed by accident._\n","author":{"url":"https://github.com/jinmay","@type":"Person","name":"jinmay"},"datePublished":"2026-07-18T14:22:33.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/8317/RustPython/issues/8317"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:4966f6b6-9731-f33e-54df-618cc391f2cb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9196:E7B0B:29F890E:3D1B6EB:6A60D51C |
| html-safe-nonce | 0f6f1ceb75e5578300e028cf4b9a252a51fadbec22014df710144b163b89b4f1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTk2OkU3QjBCOjI5Rjg5MEU6M0QxQjZFQjo2QTYwRDUxQyIsInZpc2l0b3JfaWQiOiIyODkyNDM4MzMxMzQyMjQ3MTk2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 79664bd1517aefaf9c6f5b02473595713b8a39214fc1a039ea934e0e5a8373fa |
| hovercard-subject-tag | issue:4918631714 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/RustPython/RustPython/8317/issue_layout |
| twitter:image | https://opengraph.githubassets.com/06f31139e9e1a009b6d012406a64211797beafa9aac9e67a770577393b64a9c4/RustPython/RustPython/issues/8317 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/06f31139e9e1a009b6d012406a64211797beafa9aac9e67a770577393b64a9c4/RustPython/RustPython/issues/8317 |
| og:image:alt | Feature Follow-up from #8254 (found by @doma17). With QUOTE_MINIMAL and a custom lineterminator (not CR/LF), embedded \r/\n in a field are not quoted, so the output differs from CPython. import csv... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jinmay |
| hostname | github.com |
| expected-hostname | github.com |
| None | 025e511fb0e6dd11aaa36892212f7bcc13708244bc2bcbeff1cf34fc77723812 |
| turbo-cache-control | no-preview |
| go-import | github.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git |
| octolytics-dimension-user_id | 39710557 |
| octolytics-dimension-user_login | RustPython |
| octolytics-dimension-repository_id | 135201145 |
| octolytics-dimension-repository_nwo | RustPython/RustPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 135201145 |
| octolytics-dimension-repository_network_root_nwo | RustPython/RustPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 405b1f59618e9c5e102e2408c26ce58f1937fbca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width