Skip to content

Commit db5ebef

Browse files
fangerertimfel
authored andcommitted
Fix: accept all Python coding error actions
(cherry picked from commit e16747d)
1 parent 134315b commit db5ebef

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextUnicodeBuiltins.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,6 @@ Object split(Object string, Object sep, Object maxsplit,
833833

834834
@CApiBuiltin(ret = PyObjectTransfer, args = {Pointer, Py_ssize_t, ConstCharPtrAsTruffleString, Int}, call = Ignored)
835835
abstract static class PyTruffleUnicode_DecodeUTF8Stateful extends CApiQuaternaryBuiltinNode {
836-
837836
@Specialization
838837
Object doUtf8Decode(Object cByteArray, long size, TruffleString errors, @SuppressWarnings("unused") int reportConsumed,
839838
@Cached GetByteArrayNode getByteArrayNode) {
@@ -855,7 +854,7 @@ private static Object[] decode(TruffleString errors, byte[] bytes) {
855854
CharBuffer resultBuffer = CharBuffer.allocate(n * 4);
856855

857856
CharsetDecoder decoder = StandardCharsets.UTF_8.newDecoder();
858-
CodingErrorAction action = BytesBuiltins.toCodingErrorAction(errors, PRaiseNode.getUncached(), TruffleString.EqualNode.getUncached());
857+
CodingErrorAction action = CodecsModuleBuiltins.convertCodingErrorAction(errors, TruffleString.EqualNode.getUncached());
859858
decoder.onMalformedInput(CodingErrorAction.REPORT).onUnmappableCharacter(action).decode(inputBuffer, resultBuffer, true);
860859
int len = resultBuffer.position();
861860
TruffleString string;

0 commit comments

Comments
 (0)