Skip to content

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 :)

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

Labels

None yet

4 participants