<p>The interpreter uses the standard streams internally, and they're one of the first things created during interpreter startup. User provided code doesn't start running until well after they're initialised. </p>
<p>If user level code doesn't want those streams, it needs to replace them with something else.</p>
<p>Cheers,<br>
Nick.</p>
<p>--<br>
Sent from my phone, thus the relative brevity :) </p>
<div class="gmail_quote">On Jun 8, 2012 7:03 AM, "Rurpy" <<a href="mailto:rurpy@yahoo.com">rurpy@yahoo.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 06/07/2012 12:27 AM, Paul Moore wrote:<br>
> One suggestion, which would probably shed some light on whether this<br>
> should be viewed as something "simple and reasonable", would be to do<br>
> some research on how the same task would be achieved in other<br>
> languages.<br>
<br>
Yes, that is a good idea. If I decide to reraise this<br>
suggestion at some point, I will try to do as you suggest.<br>
<br>
> I have no experience to contribute but my intuition says<br>
> that this could well be hard on other languages too.<br>
<br>
Again, I have yet to be convinced this is hard. I am<br>
very sceptical it is hard in the case of streams before<br>
they've been written or read. Replacing sys.stdout<br>
with a wrapper that encodes with the alternate encoding<br>
clearly works -- it just needs to be encapsulated so the<br>
user doesn't need to figure out all the details in order<br>
to use it.<br>
<br>
> Would you be<br>
> willing to do some web searches to look for solutions in (say) Java,<br>
> or C#, or Ruby? In theory, it shouldn't take long (as otherwise you<br>
> can conclude that the solution is obscure to the same extent that it<br>
> is with Python).<br>
><br>
> Even better, if those other languages do have a simple solution, it<br>
> may suggest an approach that would be appropriate for Python.<br>
<br>
<br>
_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/python-ideas" target="_blank">http://mail.python.org/mailman/listinfo/python-ideas</a><br>
</blockquote></div>