mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #9992: Remove PYTHONFSENCODING environment variable.
This commit is contained in:
parent
aa96592a59
commit
8f6b6b0cc3
8 changed files with 8 additions and 100 deletions
|
@ -980,22 +980,12 @@ initfsencoding(void)
|
|||
char *codeset = NULL;
|
||||
|
||||
if (Py_FileSystemDefaultEncoding == NULL) {
|
||||
const char *env_encoding = Py_GETENV("PYTHONFSENCODING");
|
||||
if (env_encoding != NULL) {
|
||||
codeset = get_codec_name(env_encoding);
|
||||
if (!codeset) {
|
||||
fprintf(stderr, "PYTHONFSENCODING is not a valid encoding:\n");
|
||||
PyErr_Print();
|
||||
}
|
||||
}
|
||||
if (!codeset) {
|
||||
/* On Unix, set the file system encoding according to the
|
||||
user's preference, if the CODESET names a well-known
|
||||
Python codec, and Py_FileSystemDefaultEncoding isn't
|
||||
initialized by other means. Also set the encoding of
|
||||
stdin and stdout if these are terminals. */
|
||||
codeset = get_codeset();
|
||||
}
|
||||
/* On Unix, set the file system encoding according to the
|
||||
user's preference, if the CODESET names a well-known
|
||||
Python codec, and Py_FileSystemDefaultEncoding isn't
|
||||
initialized by other means. Also set the encoding of
|
||||
stdin and stdout if these are terminals. */
|
||||
codeset = get_codeset();
|
||||
if (codeset != NULL) {
|
||||
if (redecode_filenames(codeset))
|
||||
Py_FatalError("Py_Initialize: can't redecode filenames");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue