diff --git a/src/execnet/gateway_base.py b/src/execnet/gateway_base.py index 73dc7175..45debc16 100644 --- a/src/execnet/gateway_base.py +++ b/src/execnet/gateway_base.py @@ -1062,6 +1062,8 @@ def _finished_receiving(self) -> None: class ChannelFile: + encoding = "utf-8" + def __init__(self, channel: Channel, proxyclose: bool = True) -> None: self.channel = channel self._proxyclose = proxyclose diff --git a/testing/test_channel.py b/testing/test_channel.py index d4712277..266a55ca 100644 --- a/testing/test_channel.py +++ b/testing/test_channel.py @@ -308,6 +308,11 @@ def f(item): class TestChannelFile: + def test_channel_file_encoding(self, gw: Gateway) -> None: + channel = gw.newchannel() + assert channel.makefile("r").encoding == "utf-8" + assert channel.makefile("w").encoding == "utf-8" + def test_channel_file_write(self, gw: Gateway) -> None: channel = gw.remote_exec( """