Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify error message in csv module #85053

Closed
cool-RR mannequin opened this issue Jun 5, 2020 · 3 comments
Closed

Clarify error message in csv module #85053

cool-RR mannequin opened this issue Jun 5, 2020 · 3 comments
Labels
3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@cool-RR
Copy link
Mannequin

cool-RR mannequin commented Jun 5, 2020

BPO 40876
Nosy @cool-RR, @nanjekyejoannah
PRs
  • bpo-40876: Clarify error message in the csv module #20653
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-06-05.20:58:07.999>
    created_at = <Date 2020-06-05.17:00:03.928>
    labels = ['type-bug', 'library', '3.10']
    title = 'Clarify error message in csv module'
    updated_at = <Date 2020-06-05.20:58:07.998>
    user = 'https://github.com/cool-RR'

    bugs.python.org fields:

    activity = <Date 2020-06-05.20:58:07.998>
    actor = 'nanjekyejoannah'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-06-05.20:58:07.999>
    closer = 'nanjekyejoannah'
    components = ['Library (Lib)']
    creation = <Date 2020-06-05.17:00:03.928>
    creator = 'cool-RR'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40876
    keywords = ['patch']
    message_count = 3.0
    messages = ['370769', '370785', '370786']
    nosy_count = 2.0
    nosy_names = ['cool-RR', 'nanjekyejoannah']
    pr_nums = ['20653']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40876'
    versions = ['Python 3.10']

    @cool-RR
    Copy link
    Mannequin Author

    cool-RR mannequin commented Jun 5, 2020

    I was working with the csv module, and I vaguely remembered that you should open files in binary mode. So I did.

    Then I saw this error message:

    _csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)
    

    I read the end and thought "I didn't open it in text mode, what does it want from me?!" It took a careful reading to figure out that I was *supposed to* open it in text mode.

    I'm going to open a PR to slightly change the text to:

    _csv.Error: iterator should return strings, not bytes (the file should be opened in text mode)
    

    @cool-RR cool-RR mannequin added 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jun 5, 2020
    @nanjekyejoannah
    Copy link
    Member

    New changeset 235f918 by Ram Rachum in branch 'master':
    bpo-40876: Clarify error message in the csv module (GH-20653)
    235f918

    @nanjekyejoannah
    Copy link
    Member

    PR merged. We can close this. Thanks Ram.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant