A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20170312/20052d08/attachment.html below:

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 12 March 2017 at 08:36, Jakub Wilk <span dir="ltr"><<a href="mailto:jwilk@jwilk.net" target="_blank">jwilk@jwilk.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is a very bad idea.<br>
<br>
It seems to based on an assumption that the C locale is always some kind of pathology. Admittedly, it sometimes is a result of misconfiguration or a mistake. (But I don't see why it's the interpreter's job to correct such mistakes.) However, in some cases the C locale is a normal environment for system services, cron scripts, distro package builds and whatnot.</blockquote><br></div><div class="gmail_quote">An environment in which Python 3's eager decoding of operating system provided values to Unicode fails.<br></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

It's possible to write Python programs that are locale-agnostic.<br></blockquote><div><br></div><div>If a program is genuinely locale-agnostic, it will be unaffected by this PEP.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


It's also possible to write programs that are locale-dependent, but handle ASCII as locale encoding gracefully.<br></blockquote><div><br></div><div>No, it is not generally feasible to write such programs in Python 3. That's the essence of the problem, and why the PEP deprecates support for the legacy C locale in Python 3.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Or you might want to write a program that intentionally aborts with an explanatory error message when the locale encoding doesn't have sufficient Unicode coverage. ("Errors should never pass silently" anyone?)<br></blockquote><div><br></div><div>This is what click does, but it only does it because that isn't possible for click to do the right thing given Python 3's eager decoding of various values as ASCII.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

With this proposal, none of the above seems possible to correctly implement in Python.<br></blockquote><div><br></div><div>The first case remains unchanged, the other two will need to use Python 2.7 or Tauthon. I'm fine with that.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


* Nick Coghlan <<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>>, 2017-03-05, 17:50:<span class=""><br></span><span class=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
While this PEP ensures that developers that need to do so can still opt-in to running their Python code in the legacy C locale,<br>
</blockquote>
<br></span>
Yeah, no, it doesn't.<br>
<br>
It's impossible do disable coercion from Python code, because it happens to early. The best you can do is to write a wrapper script in a different language that sets PYTHONCOERCECLOCALE=0; but then you still get a spurious warning.<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div></div>It's not a spurious warning, as Python 3's Unicode handling for environmental interactions genuinely doesn't work properly in the legacy C locale (unless you're genuinely promising to only ever feed it ASCII values, but that isn't a realistic guarantee to make).<br><br></div><div class="gmail_extra">However, I'm also open to having that particular setting also disable the runtime warning from the shared library.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Cheers,<br></div><div class="gmail_extra">Nick.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Nick Coghlan   |   <a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>   |   Brisbane, Australia</div>
</div></div>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4