On Thu, 11 Feb 2021 at 21:05, Jim J. Jewett
Who will benefit from this new warning?
Is this basically just changing builtins.open by adding:
if encoding is None and sys.flags.encoding_warning: # and not Android and not -X utf8 ? warnings.warn(EncodingWarning("Are you sure you want locale instead of utf-8?"))
Even for the few people with the knowledge, time, interest, and authority to fix the code, is that really helpful?
Helpful enough to put it directly in python as an optional mode, separate from the dev mode or show all warnings mode? Why not just add it to a linter, or write a 2to3 style checker? Or at least emit or not based on a warnings filter?
That's a very good point. If this warning is of use, why have none of the well-known linters implemented it? And why not prototype the proposal in them, at least? Python-ideas posts routinely get pushed to justify "why can't this be done in an external library?" and that probably applies here too. Paul