[Python-checkins] bpo-29240: Don't define decode_locale() on macOS (#4895)
Victor Stinner
webhook-mailer at python.org
Fri Dec 15 17:06:25 EST 2017
https://github.com/python/cpython/commit/d2b02310acbfe6c978a8ad3cd3ac8b3f12927442
commit: d2b02310acbfe6c978a8ad3cd3ac8b3f12927442
branch: master
author: Victor Stinner <victor.stinner at gmail.com>
committer: GitHub <noreply at github.com>
date: 2017年12月15日T23:06:17+01:00
summary:
bpo-29240: Don't define decode_locale() on macOS (#4895)
Don't define decode_locale() nor encode_locale() on macOS or Android.
files:
M Python/fileutils.c
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 03cc37958a0..4b69049ce58 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -249,6 +249,7 @@ decode_ascii_surrogateescape(const char *arg, size_t *size)
}
#endif
+#if !defined(__APPLE__) && !defined(__ANDROID__)
static wchar_t*
decode_locale(const char* arg, size_t *size)
{
@@ -364,6 +365,7 @@ decode_locale(const char* arg, size_t *size)
}
return NULL;
}
+#endif
/* Decode a byte string from the locale encoding with the
@@ -453,6 +455,7 @@ _Py_EncodeLocaleUTF8(const wchar_t *text, size_t *error_pos)
return cpath;
}
+#if !defined(__APPLE__) && !defined(__ANDROID__)
static char*
encode_locale(const wchar_t *text, size_t *error_pos)
{
@@ -516,6 +519,7 @@ encode_locale(const wchar_t *text, size_t *error_pos)
}
return result;
}
+#endif
/* Encode a wide character string to the locale encoding with the
surrogateescape error handler: surrogate characters in the range
More information about the Python-checkins
mailing list