(original) (raw)
On 18 Oct 2013 15:20, "Georg Brandl" <g.brandl@gmx.net> wrote:
\>
\> Am 17.10.2013 17:36, schrieb Antoine Pitrou:
\> > On Thu, 17 Oct 2013 15:22:03 +0200 (CEST)
\> > nick.coghlan <python-checkins@python.org> wrote:
\> >>
\> >> +.. c:function:: int Py\_SetStandardStreamEncoding(char \*encoding, char \*errors)
\> >> +
\> >> + � .. index::
\> >> + � � �single: Py\_Initialize()
\> >> + � � �single: main()
\> >> + � � �triple: stdin; stdout; sdterr
\> >> +
\> >> + � This function should be called before :c:func:\`Py\_Initialize\`. It
\> >> + � specifies which encoding and error handling to use with standard io,
\> >> + � with the same meanings as in :func:\`str.encode\`.
\> >> +
\> >> + � It overrides :envvar:\`PYTHONIOENCODING\` values, and allows embedding code
\> >> + � to control io encoding when the environment variable does not work.
\> >> +
\> >> + � \`\`encoding\`\` and/or \`\`errors\`\` may be NULL to use
\> >> + � :envvar:\`PYTHONIOENCODING\` and/or default values (depending on other
\> >> + � settings).
\> >> +
\> >> + � Note that :data:\`sys.stderr\` always uses the "backslashreplace" error
\> >> + � handler, regardless of this (or any other) setting.
\> >> +
\> >> + � If :c:func:\`Py\_Finalize\` is called, this function will need to be called
\> >> + � again in order to affect subsequent calls to :c:func:\`Py\_Initialize\`.
\> >> +
\> >> + � Returns 0 if successful.
\> >> +
\> >> +
\> >
\> > Needs a versionadded tag.
\>
\> Also, shouldn't it be excluded from the stable/limited API?
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 :)
Cheers,
Nick.
>
\> Georg
\>
\> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
\> Python-Dev mailing list
\> Python-Dev@python.org
\> https://mail.python.org/mailman/listinfo/python-dev
\> Unsubscribe: https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com