GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — `_csv` `Reader` and `Writer` types shouldn't be directly instantiable · Issue #104265 · python/cpython

_csv Reader and Writer types shouldn't be directly instantiable #104265

New issue
Copy link
New issue
Copy link
Closed
#104266
Closed
_csv Reader and Writer types shouldn't be directly instantiable#104265
#104266
Copy link
Labels
type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

Description

@chgnrdv
chgnrdv
opened on May 7, 2023
Issue body actions

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:

>>> import _csv
>>> _csv.Writer().writerow([])
Segmentation fault (core dumped)
>>> import _csv
>>> list(_csv.Reader())
Segmentation fault (core dumped)

Although this is an internal detail, I'm sure that this should be fixed. I'll submit a PR shortly.
The crash appears on 3.10, 3.11 and current main.

Linked PRs

  • gh-104265 Disallow instantiation of _csv.Reader and _csv.Writer #104266
  • [3.11] gh-104265 Disallow instantiation of _csv.Reader and _csv.Writer (GH-104266) #104278
Reacted by Kirill Podoprigora and Erlend E. Aasland

Activity

  1. chgnrdv
    added
    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump
    on May 7, 2023
  2. erlend-aasland
    closed this as completedin #104266on May 7, 2023
  3. erlend-aasland
    added a commit that references this issue on May 7, 2023

    gh-104265 Disallow instantiation of `_csv.Reader` and `_csv.Writer` (#…

    06c2a48
  4. miss-islington
    added a commit that references this issue on May 7, 2023

    pythongh-104265 Disallow instantiation of `_csv.Reader` and `_csv.Wri…

    0a7ec7e
  5. kumaraditya303
    added a commit that references this issue on May 8, 2023

    [3.11] gh-104265 Disallow instantiation of `_csv.Reader` and `_csv.Wr…

    065e2ae
  6. jbower-fb
    added a commit that references this issue on May 8, 2023

    pythongh-104265 Disallow instantiation of `_csv.Reader` and `_csv.Wri…

    8e76e2d
  7. carljm
    added a commit that references this issue on May 9, 2023

    Merge branch 'main' into inlinecomp2

    76077cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-crashA hard crash of the interpreter, possibly with a core dumpA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.