Title: csv.writer: multi-character lineterminator is truncated to a single byte · Issue #8322 · RustPython/RustPython · GitHub
Open Graph Title: csv.writer: multi-character lineterminator is truncated to a single byte · Issue #8322 · RustPython/RustPython
X Title: csv.writer: multi-character lineterminator is truncated to a single byte · Issue #8322 · RustPython/RustPython
Description: Feature Follow-up from #8302 / #8315. csv.writer should accept an arbitrary string as lineterminator. RustPython stores it as a single byte, so a multi-character terminator is truncated instead of being emitted in full. import csv, io si...
Open Graph Description: Feature Follow-up from #8302 / #8315. csv.writer should accept an arbitrary string as lineterminator. RustPython stores it as a single byte, so a multi-character terminator is truncated instead of ...
X Description: Feature Follow-up from #8302 / #8315. csv.writer should accept an arbitrary string as lineterminator. RustPython stores it as a single byte, so a multi-character terminator is truncated instead of ...
Opengraph URL: https://github.com/RustPython/RustPython/issues/8322
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"csv.writer: multi-character lineterminator is truncated to a single byte","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 #8302 / #8315.\n\n`csv.writer` should accept an arbitrary string as `lineterminator`. RustPython stores it as a single byte, so a multi-character terminator is truncated instead of being emitted in full.\n\n```python\nimport csv, io\nsio = io.StringIO()\ncsv.writer(sio, lineterminator=\"!@#\").writerow([\"a\", \"b\"])\nprint(repr(sio.getvalue()))\n# CPython: 'a,b!@#'\n# RustPython: 'a,b!'\n```\n\nBecause of this, `test_write_lineterminator` (Lib/test/test_csv.py) is marked `@unittest.expectedFailure` — it fails only on the `'!@#'` subcase.\n\nScope is limited to the multi-character `lineterminator`. Left as separate follow-ups: lineterminator validation parity, non-ASCII `delimiter`/`quotechar`/`escapechar` (see #8310), and reader semantics (CPython's reader ignores `lineterminator` and only recognizes CR/LF).\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.Dialect.lineterminator\n\n\u003csub\u003eDrafted with AI assistance (Claude Code), reviewed by me.\u003c/sub\u003e","author":{"url":"https://github.com/jinmay","@type":"Person","name":"jinmay"},"datePublished":"2026-07-19T12:10:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/8322/RustPython/issues/8322"}
| 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:bc689818-4591-ecd9-d287-7b2cb2a7e3a7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 88AC:2B4B1:43B0666:5EB7D01:6A5FB3DA |
| html-safe-nonce | eeddbe9c57a4f348cedc797dc25b93361465db19c182ad67fa7c7c13c7ba6bbc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OEFDOjJCNEIxOjQzQjA2NjY6NUVCN0QwMTo2QTVGQjNEQSIsInZpc2l0b3JfaWQiOiIyNDk0NzE5Mzg2MTYwNDQ0Mzc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 73ab9fa12f3137bc887386a7571e24e1d36f7dec951b36c7659fa9adcb788f4f |
| hovercard-subject-tag | issue:4922602552 |
| 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/8322/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8839dbdf9305ec444c573e3334f1621277b442aeb3d0234df9ffe5624bf9a4d1/RustPython/RustPython/issues/8322 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8839dbdf9305ec444c573e3334f1621277b442aeb3d0234df9ffe5624bf9a4d1/RustPython/RustPython/issues/8322 |
| og:image:alt | Feature Follow-up from #8302 / #8315. csv.writer should accept an arbitrary string as lineterminator. RustPython stores it as a single byte, so a multi-character terminator is truncated instead of ... |
| 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 | 1ec7085bd7214c509393537f93bc21c48856549e31538b70bdb3cc4df7eb5f70 |
| 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 | b0ff0ab699186747983f122c82d4ebc71a1c22b4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width