Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,8 @@ public void postInitialize(Python3Core core) {
PosixSupportLibrary posixLib = PosixSupportLibrary.getUncached();
Object posixSupport = core.getContext().getPosixSupport();
PythonModule posix = PythonLanguage.getPythonOS() == PythonOS.PLATFORM_WIN32
? core.lookupBuiltinModule(T_NT) : core.lookupBuiltinModule(T_POSIX);
? core.lookupBuiltinModule(T_NT)
: core.lookupBuiltinModule(T_POSIX);

if (posixLib.getBackend(posixSupport).toJavaStringUncached().equals("java")) {
posix.setAttribute(toTruffleStringUncached("geteuid"), PNone.NO_VALUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,9 @@ private static TruffleString parseStringUnicodeSlowpath(VirtualFrame frame, Boun
while (idx < length) {
int c = codePointAtIndexNode.execute(string, idx++);
if (c == '"') {
if (highSurrogate != 0) {
appendCodePointNode.execute(builder, highSurrogate, 1, true);
}
// we reached the end of the string literal
nextIdx.value = idx;
return builderToStringNode.execute(builder);
Expand Down Expand Up @@ -934,6 +937,10 @@ private static TruffleString parseStringUnicodeSlowpath(VirtualFrame frame, Boun
}
if (isLowSurrogate(c) && highSurrogate != 0) {
c = Character.toCodePoint(highSurrogate, (char) c);
highSurrogate = 0;
} else if (highSurrogate != 0) {
appendCodePointNode.execute(builder, highSurrogate, 1, true);
highSurrogate = 0;
}
if (isHighSurrogate(c)) {
highSurrogate = (char) c;
Expand All @@ -946,6 +953,10 @@ private static TruffleString parseStringUnicodeSlowpath(VirtualFrame frame, Boun
if (strict && c < 0x20) {
throw decodeError(frame, boundaryCallData, inliningTarget, errorProfile, raisingNode, string, idx - 1, ErrorMessages.INVALID_CTRL_CHARACTER_AT);
}
if (highSurrogate != 0) {
appendCodePointNode.execute(builder, highSurrogate, 1, true);
highSurrogate = 0;
}
appendCodePointNode.execute(builder, c, 1, true);
}
}
Expand Down
Loading