Title: `_csv` `Reader` and `Writer` types shouldn't be directly instantiable · Issue #104265 · python/cpython · GitHub
Open Graph Title: `_csv` `Reader` and `Writer` types shouldn't be directly instantiable · Issue #104265 · python/cpython
X Title: `_csv` `Reader` and `Writer` types shouldn't be directly instantiable · Issue #104265 · python/cpython
Description: The accepted way to create these objects is to use constructor functions _csv.reader() and _csv.writer() with appropriate arguments. Objects that are created through type constructors _csv.Reader and _csv.Writer turn out to be not proper...
Open Graph Description: The accepted way to create these objects is to use constructor functions _csv.reader() and _csv.writer() with appropriate arguments. Objects that are created through type constructors _csv.Reader a...
X Description: The accepted way to create these objects is to use constructor functions _csv.reader() and _csv.writer() with appropriate arguments. Objects that are created through type constructors _csv.Reader a...
Opengraph URL: https://github.com/python/cpython/issues/104265
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`_csv` `Reader` and `Writer` types shouldn't be directly instantiable","articleBody":"The accepted way to create these objects is to use constructor functions `_csv.reader()` and `_csv.writer()` with appropriate arguments. Objects that are created through type constructors `_csv.Reader` and `_csv.Writer` turn out to be not properly initialized, and operations on them easily lead to crash:\r\n```python\r\n\u003e\u003e\u003e import _csv\r\n\u003e\u003e\u003e _csv.Writer().writerow([])\r\nSegmentation fault (core dumped)\r\n```\r\n```python\r\n\u003e\u003e\u003e import _csv\r\n\u003e\u003e\u003e list(_csv.Reader())\r\nSegmentation fault (core dumped)\r\n```\r\nAlthough this is an internal detail, I'm sure that this should be fixed. I'll submit a PR shortly.\r\nThe crash appears on 3.10, 3.11 and current main.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-104266\n* gh-104278\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/chgnrdv","@type":"Person","name":"chgnrdv"},"datePublished":"2023-05-07T12:24:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/104265/cpython/issues/104265"}
| 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:4bbdab7c-9ad6-9443-9d56-257a9cd853b6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 918E:15B3F8:91ECA1:C3C6E2:69697D72 |
| html-safe-nonce | fb689bbd1d60b88f808146a8cfb12f8b01a66264469c3912e65a02aff963590b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MThFOjE1QjNGODo5MUVDQTE6QzNDNkUyOjY5Njk3RDcyIiwidmlzaXRvcl9pZCI6IjYyNjEwNzYyMTIwMjUyMjg2NTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 658af1b1ba1b7bfe443225a0a916b6ee102e6710b6482463cef500da3697f5a3 |
| hovercard-subject-tag | issue:1699042006 |
| 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/python/cpython/104265/issue_layout |
| twitter:image | https://opengraph.githubassets.com/07289a70be350fa8f29e963d66d957fdd359badaec97495d13f076f70b4566dd/python/cpython/issues/104265 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/07289a70be350fa8f29e963d66d957fdd359badaec97495d13f076f70b4566dd/python/cpython/issues/104265 |
| og:image:alt | The accepted way to create these objects is to use constructor functions _csv.reader() and _csv.writer() with appropriate arguments. Objects that are created through type constructors _csv.Reader a... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chgnrdv |
| hostname | github.com |
| expected-hostname | github.com |
| None | f33e4b94c8824ab2b434d82a94139432fb5ebee9df4b75304140ad22508c4a77 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | 48f380098b30acbb700b04f1724481ca10d574fc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width