Skip to content

Commit 00e1882

Browse files
committed
define Py_FileSystemDefaultEncoding in native mode
1 parent aa08cf7 commit 00e1882

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

graalpython/com.oracle.graal.python.cext/src/capi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,8 @@ PyAPI_FUNC(void) initialize_graal_capi(ptr_cache_t _pythonToNative, void_ptr_cac
12691269
initialize_hashes();
12701270
initialize_bufferprocs();
12711271

1272-
// TODO: initialize during cext initialization doesn't work at the moment
1272+
// TODO: initialize during cext initialization doesn't work at the moment
1273+
// This is hardcoded the same way in capi_native.c
12731274
Py_FileSystemDefaultEncoding = "utf-8"; // strdup(PyUnicode_AsUTF8(GraalPyTruffle_FileSystemDefaultEncoding()));
12741275

12751276
PyTruffle_Log(PY_TRUFFLE_LOG_FINE, "initialize_graal_capi: %fs", ((double) (clock() - t)) / CLOCKS_PER_SEC);

graalpython/com.oracle.graal.python.jni/src/capi_native.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,3 +562,9 @@ char _PyByteArray_empty_string[] = "";
562562
#include "complexobject.c"
563563
#include "dictobject.c"
564564
#include "modsupport_shared.c"
565+
566+
/*
567+
* This mirrors the definition in capi.c that we us on Sulong, and needs to be
568+
* fixed when that is.
569+
*/
570+
const char *Py_FileSystemDefaultEncoding = "utf-8";

0 commit comments

Comments
 (0)