summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclIO.c7
-rw-r--r--tests/io.test6
2 files changed, 5 insertions, 8 deletions
diff --git a/generic/tclIO.c b/generic/tclIO.c
index c6402f1..e00b99b 100644
--- a/generic/tclIO.c
+++ b/generic/tclIO.c
@@ -4409,11 +4409,8 @@ Write(
* We're reading from invalid/incomplete UTF-8.
*/
- if (total == 0) {
- Tcl_SetErrno(EILSEQ);
- return -1;
- }
- break;
+ encodingError = 1;
+ result = TCL_OK;
}
bufPtr->nextAdded += dstWrote;
diff --git a/tests/io.test b/tests/io.test
index e4f68be..32c4b99 100644
--- a/tests/io.test
+++ b/tests/io.test
@@ -8566,7 +8566,7 @@ test io-60.1 {writing illegal utf sequences} {fileevent testbytestring} {
set out [open $path(script) w]
puts $out "catch {load $::tcltestlib Tcltest}"
puts $out {
- puts [testbytestring \xE2]
+ puts ABC[testbytestring \xE2]
exit 1
}
proc readit {pipe} {
@@ -8590,7 +8590,7 @@ test io-60.1 {writing illegal utf sequences} {fileevent testbytestring} {
# cut of the remainder of the error stack, especially the filename
set result [lreplace $result 3 3 [lindex [split [lindex $result 3] \n] 0]]
list $x $result
-} {1 {gets {} catch {error writing "stdout": illegal byte sequence}}}
+} {1 {gets ABC catch {error writing "stdout": illegal byte sequence}}}
test io-61.1 {Reset eof state after changing the eof char} -setup {
set datafile [makeFile {} eofchar]
@@ -9020,7 +9020,7 @@ test io-75.4 {shiftjis encoding error read results in raw bytes} -setup {
flush $f
seek $f 0
fconfigure $f -encoding shiftjis -buffering none -eofchar "" -translation lf
-} -body {
+} -constraints deprecated -body {
set d [read $f]
binary scan $d H* hd
set hd