[WIP] bpo-37214: Add a new EncodingWarning warning category#13938
[WIP] bpo-37214: Add a new EncodingWarning warning category#13938vstinner wants to merge 1 commit intopython:masterfrom vstinner:encoding_warning
Conversation
open() now emits an EncodingWarning if called with encoding=None.
|
@methane: What do you think of this approach? Does it make any sense to have an opt-in warning? |
No. Warning everytime when encoding is omitted was @zooba 's suggestion. But he opposite to change default encoding strongly. In PEP 597 (2nd), I am proposing adding more option. macOS user can test their code easily with Anyway, I'm thinking about advertising your UTF-8 mode. |
|
Ok. I may keep this PR open to show that always emit a warning can be a bad idea :-) |
|
I wrote this PR to discuss https://www.python.org/dev/peps/pep-0597/ but it's unrelated to the implementation of this PEP :-) |
|
I abandon this PR. |
Copied from python#13938
open() now emits a EncodingWarning if called with encoding=None.
https://bugs.python.org/issue37214