Skip to content

bpo-40876: Clarify error message in the csv module #20653

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

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

cool-RR
Copy link
Contributor

@cool-RR cool-RR 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.

This PR slightly changes the text to:

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

https://bugs.python.org/issue40876

@cool-RR cool-RR marked this pull request as ready for review June 5, 2020 17:03
@cool-RR cool-RR force-pushed the 2020-06-05-csv-text-mode branch from 2e07f8c to bb4cfc6 Compare June 5, 2020 17:03
@cool-RR cool-RR changed the title Clarify error message in the csv module bpo-40876: Clarify error message in the csv module Jun 5, 2020
Copy link
Contributor

@nanjekyejoannah nanjekyejoannah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @cool-RR. There is no need for a news entry for small doc fixes.

@nanjekyejoannah nanjekyejoannah merged commit 235f918 into python:master Jun 5, 2020
@cool-RR
Copy link
Contributor Author

cool-RR commented Jun 5, 2020

Yay :)

arun-mani-j pushed a commit to arun-mani-j/cpython that referenced this pull request Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants