Always initialize Py_FileSystemDefaultEncoding on Unix in Py_Initialize,

and not as a side effect of setlocale. Expose it as sys.getfilesystemencoding.
Adjust test case.
This commit is contained in:
Martin v. Löwis 2003-03-05 15:13:47 +00:00
parent 620c0837bd
commit 73d538b9c6
6 changed files with 67 additions and 22 deletions

View file

@ -211,6 +211,22 @@ It is always available.
\versionadded{2.2}
\end{funcdesc}
\begin{funcdesc}{getfilesystemencoding}{}
Return the name of the encoding used to convert Unicode filenames
into system file names, or \code{None} if the system default encoding
is used. The result value depends on the operating system:
\begin{itemize}
\item On Windows 9x, the encoding is ``mbcs''.
\item On Mac OS X, the encoding is ``utf-8''.
\item On Unix, the encoding is the user's preference
according to the result of nl_langinfo(CODESET), or None if
the nl_langinfo(CODESET) failed.
\item On Windows NT+, file names are Unicode natively, so no conversion
is performed.
\end{itemize}
\versionadded{2.3}
\end{funcdesc}
\begin{funcdesc}{getrefcount}{object}
Return the reference count of the \var{object}. The count returned
is generally one higher than you might expect, because it includes