<p dir="ltr"><br>
On 18 Oct 2013 15:20, "Georg Brandl" <<a href="mailto:g.brandl@gmx.net">g.brandl@gmx.net</a>> wrote:<br>
><br>
> Am 17.10.2013 17:36, schrieb Antoine Pitrou:<br>
> > On Thu, 17 Oct 2013 15:22:03 +0200 (CEST)<br>
> > nick.coghlan <<a href="mailto:python-checkins@python.org">python-checkins@python.org</a>> wrote:<br>
> >><br>
> >> +.. c:function:: int Py_SetStandardStreamEncoding(char *encoding, char *errors)<br>
> >> +<br>
> >> + .. index::<br>
> >> + single: Py_Initialize()<br>
> >> + single: main()<br>
> >> + triple: stdin; stdout; sdterr<br>
> >> +<br>
> >> + This function should be called before :c:func:`Py_Initialize`. It<br>
> >> + specifies which encoding and error handling to use with standard io,<br>
> >> + with the same meanings as in :func:`str.encode`.<br>
> >> +<br>
> >> + It overrides :envvar:`PYTHONIOENCODING` values, and allows embedding code<br>
> >> + to control io encoding when the environment variable does not work.<br>
> >> +<br>
> >> + ``encoding`` and/or ``errors`` may be NULL to use<br>
> >> + :envvar:`PYTHONIOENCODING` and/or default values (depending on other<br>
> >> + settings).<br>
> >> +<br>
> >> + Note that :data:`sys.stderr` always uses the "backslashreplace" error<br>
> >> + handler, regardless of this (or any other) setting.<br>
> >> +<br>
> >> + If :c:func:`Py_Finalize` is called, this function will need to be called<br>
> >> + again in order to affect subsequent calls to :c:func:`Py_Initialize`.<br>
> >> +<br>
> >> + Returns 0 if successful.<br>
> >> +<br>
> >> +<br>
> ><br>
> > Needs a versionadded tag.<br>
><br>
> Also, shouldn't it be excluded from the stable/limited API?</p>
<p dir="ltr">Since it didn't expose any struct layouts, I just followed the precedent set by the other PySet_* APIs on that front. Moving it would be fine, too, though, since "embedding the interpreter" and "using the limited API" don't exactly mix :)</p>
<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> Georg<br>
><br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com">https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com</a><br>
</p>