Skip to content

Commit 7b005ad

Browse files
authored
Fix string embedded null character in Python 3.12 as well
1 parent dfca716 commit 7b005ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/StrType.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ PyObject *StrType::proxifyString(JSContext *cx, JS::HandleValue strVal) {
135135

136136
if (JS::LinearStringHasLatin1Chars(lstr)) { // latin1 spidermonkey, latin1 python
137137
const JS::Latin1Char *chars = JS::GetLatin1LinearStringChars(nogc, lstr);
138-
if ((PY_VERSION_HEX) >= 0x030d0000) { // Python version is greater than 3.13
138+
if ((PY_VERSION_HEX) >= 0x030c0000) { // Python version is greater than 3.12
139139
// Short path to temporarily fix the issue with Python 3.13+ compact unicode representation.
140140
// It would error with `ValueError: embedded null character`, which is caused by the fact that
141141
// most Python C APIs assume the string buffer is null-terminated, so we need to create a copy.

0 commit comments

Comments
 (0)