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
1 change: 1 addition & 0 deletions news/430.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added an ``encoding`` attribute to ``ChannelFileWrite``.
2 changes: 2 additions & 0 deletions src/execnet/gateway_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,6 +1079,8 @@ def __repr__(self) -> str:


class ChannelFileWrite(ChannelFile):
encoding = "utf-8"

def write(self, out: bytes) -> None:
self.channel.send(out)

Expand Down
1 change: 1 addition & 0 deletions testing/test_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ def test_channel_file_write_error(self, gw: Gateway) -> None:
channel = gw.remote_exec("pass")
f = channel.makefile()
assert not f.isatty()
assert f.encoding == "utf-8"
channel.waitclose(TESTTIMEOUT)
with pytest.raises(IOError):
f.write(b"hello")
Expand Down