Skip to content

Add warnings about text/binary mode files.#2825

Merged
sigmavirus24 merged 2 commits intopsf:masterfrom
Lukasa:universal_newlines
Oct 24, 2015
Merged

Add warnings about text/binary mode files.#2825
sigmavirus24 merged 2 commits intopsf:masterfrom
Lukasa:universal_newlines

Conversation

@Lukasa
Copy link
Member

@Lukasa Lukasa commented Oct 14, 2015

Resolves #2725.

@sigmavirus24 I'm wondering if we should add a warning to super_len for whenever we decide on the length of the file using os.fstat, if the file has not been opened in binary mode. It should be easy enough to do. Thoughts?

@sigmavirus24
Copy link
Contributor

@Lukasa do we want to add that warning in super_len and then make it a hard exception in 3.0.0?

@Lukasa
Copy link
Member Author

Lukasa commented Oct 14, 2015

@sigmavirus24 Yeah, probably.

@chrismattmann
Copy link

♥ thanks brosephs @sigmavirus24 @Lukasa

@sigmavirus24
Copy link
Contributor

@Lukasa do you want me to send that separately or do you want to do that as part of this PR?

@Lukasa
Copy link
Member Author

Lukasa commented Oct 24, 2015

Ah, I forgot about that. Let's do it here.

@Lukasa
Copy link
Member Author

Lukasa commented Oct 24, 2015

Ok, I added a warning that should fire once the first time this happens (no need to spam the crap out of people with it). It's strictly a subclass of DeprecationWarning, which I think is ok too.

sigmavirus24 added a commit that referenced this pull request Oct 24, 2015
Add warnings about text/binary mode files.
@sigmavirus24 sigmavirus24 merged commit d290a9b into psf:master Oct 24, 2015
@sigmavirus24
Copy link
Contributor

Excellent work @Lukasa . Thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants