We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 404f81e commit dd28e28Copy full SHA for dd28e28
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/str/StringBuiltins.java
@@ -1157,7 +1157,7 @@ public abstract static class SplitLinesNode extends PythonBuiltinNode {
1157
@Specialization
1158
@TruffleBoundary
1159
public PList split(String str, @SuppressWarnings("unused") PNone keepends) {
1160
- String[] split = str.split("\n");
+ String[] split = str.split("\n", -1); // -1 is needed to include trailing empty strings
1161
return factory().createList(Arrays.copyOf(split, split.length, Object[].class));
1162
}
1163
0 commit comments