Title: csv.writer: embedded \r/\n not quoted with a custom lineterminator (QUOTE_MINIMAL) · Issue #8302 · RustPython/RustPython · GitHub
Open Graph Title: csv.writer: embedded \r/\n not quoted with a custom lineterminator (QUOTE_MINIMAL) · Issue #8302 · RustPython/RustPython
X Title: csv.writer: embedded \r/\n not quoted with a custom lineterminator (QUOTE_MINIMAL) · Issue #8302 · 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/8302
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","author":{"url":"https://github.com/jinmay","@type":"Person","name":"jinmay"},"datePublished":"2026-07-17T08:49:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/8302/RustPython/issues/8302"}
| 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:0d256208-536d-f8e7-1a86-e4ab00629e99 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C0B8:1A1383:20AAD6F:2CD92B5:6A60962D |
| html-safe-nonce | 8c71161928ccdd96d949fc00027a059678a38712d0abf74e38cd284bb4ec9dbe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMEI4OjFBMTM4MzoyMEFBRDZGOjJDRDkyQjU6NkE2MDk2MkQiLCJ2aXNpdG9yX2lkIjoiMTI1NjY3MDU4MTc3NDkxNTExNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 376ceb5c879740da0a20f2c9f495699ae780647050d1b533cfbcb6f124a07730 |
| hovercard-subject-tag | issue:4909687639 |
| 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/8302/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5626ef487b885fc5320c87a0d3bb78b5320c7e47d5145505e8ca07c3138c5c55/RustPython/RustPython/issues/8302 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5626ef487b885fc5320c87a0d3bb78b5320c7e47d5145505e8ca07c3138c5c55/RustPython/RustPython/issues/8302 |
| 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 | 5142d23feb6a650085422edf60d68c93777dfa6c4b0c9151eb464d3e4969f618 |
| 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 | 6211071718785f6af328d66ee8cf4a7ce606987e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width