Skip to content

Commit 7e0dfeb

Browse files
committed
Mark _Py_EncodeLocaleRaw() as static
1 parent 0caf0ce commit 7e0dfeb

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

‎Include/internal/pycore_fileutils.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ PyAPI_FUNC(int) _Py_EncodeLocale(
4040
int current_locale,
4141
_Py_error_handler errors);
4242

43-
extern char* _Py_EncodeLocaleRaw(
44-
const wchar_t *text,
45-
size_t *error_pos);
46-
4743
extern PyObject* _Py_device_encoding(int);
4844

4945
#if defined(MS_WINDOWS) || defined(__APPLE__)

‎Python/fileutils.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ decode_locale_impl(const char* arg, wchar_t **wstr, size_t *wlen,
683683
// Return _Py_CODEC_UNSUPPORTED_ERROR_HANDLER (-3) if the 'errors' error
684684
// handler is not supported: other than "strict" and "surrogateescape".
685685
//
686-
// Use the Py_EncodeLocaleEx() function to encode the character string back to
686+
// Use the _Py_EncodeLocale() function to encode the character string back to
687687
// a byte string.
688688
//
689689
// arg and wstr must not be NULL.
@@ -749,8 +749,7 @@ wchar_t*
749749
Py_DecodeLocale(const char* arg, size_t *wlen)
750750
{
751751
wchar_t *wstr;
752-
int res = _Py_DecodeLocale(arg, &wstr, wlen, 0,
753-
_Py_ERROR_SURROGATEESCAPE);
752+
int res = _Py_DecodeLocale(arg, &wstr, wlen, 0, _Py_ERROR_SURROGATEESCAPE);
754753
if (res != 0) {
755754
assert(res == _Py_CODEC_MEMORY_ERROR || res == _Py_CODEC_DECODE_ERROR);
756755
if (wlen != NULL) {
@@ -1033,7 +1032,7 @@ Py_EncodeLocale(const wchar_t *text, size_t *error_pos)
10331032

10341033
/* Similar to Py_EncodeLocale(), but result must be freed by PyMem_RawFree()
10351034
instead of PyMem_Free(). */
1036-
char*
1035+
static char*
10371036
_Py_EncodeLocaleRaw(const wchar_t *text, size_t *error_pos)
10381037
{
10391038
return encode_locale(text, error_pos, 1, 0);

0 commit comments

Comments
 (0)