This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Clarify error message in csv module
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.10
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: cool-RR, nanjekyejoannah
Priority: normal Keywords: patch

Created on 2020-06-05 17:00 by cool-RR, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 20653 merged cool-RR, 2020-06-05 17:06
Messages (3)
msg370769 - (view) Author: Ram Rachum (cool-RR) * Date: 2020-06-05 17:00
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)
msg370785 - (view) Author: Joannah Nanjekye (nanjekyejoannah) * (Python committer) Date: 2020-06-05 20:56
New changeset 235f918f44bb89e27190db2f1823d191dbd4ad28 by Ram Rachum in branch 'master':
bpo-40876: Clarify error message in the csv module (GH-20653)
msg370786 - (view) Author: Joannah Nanjekye (nanjekyejoannah) * (Python committer) Date: 2020-06-05 20:58
PR merged. We can close this. Thanks Ram.
Date User Action Args
2022-04-11 14:59:32adminsetgithub: 85053
2020-06-05 20:58:07nanjekyejoannahsetstatus: open -> closed

messages: + msg370786
stage: patch review -> resolved
2020-06-05 20:56:13nanjekyejoannahsetnosy: + nanjekyejoannah
messages: + msg370785
2020-06-05 17:06:02cool-RRsetkeywords: + patch
stage: patch review
pull_requests: + pull_request19873
2020-06-05 17:00:03cool-RRcreate