summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2018-01-11 09:37:59 (GMT)
committerGitHub <noreply@github.com>2018-01-11 09:37:59 (GMT)
commitcb3ae5588bd7733e76dc09277bb7626652d9bb64 (patch)
tree137a100f35284a1327a8ec38052433aa21e13281 /Objects
parent3948207c610e931831828d33aaef258185df31db (diff)
downloadcpython-cb3ae5588bd7733e76dc09277bb7626652d9bb64.zip
cpython-cb3ae5588bd7733e76dc09277bb7626652d9bb64.tar.gz
cpython-cb3ae5588bd7733e76dc09277bb7626652d9bb64.tar.bz2
bpo-29240: Ignore UTF-8 Mode in time module (#5148)
time.strftime() must use the current LC_CTYPE encoding, not UTF-8 if the UTF-8 mode is enabled. Add _PyUnicode_DecodeCurrentLocale() function.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 1a230e0..a6e02f4 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -3837,6 +3837,12 @@ _PyUnicode_DecodeCurrentLocaleAndSize(const char *str, Py_ssize_t len,
}
PyObject*
+_PyUnicode_DecodeCurrentLocale(const char *str, const char *errors)
+{
+ return unicode_decode_locale(str, (Py_ssize_t)strlen(str), errors, 1);
+}
+
+PyObject*
PyUnicode_DecodeLocale(const char *str, const char *errors)
{
Py_ssize_t size = (Py_ssize_t)strlen(str);