From: "J. Bruce Fields" <bfields@fieldses.org>
To: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] rpc: fix str to bytes conversion
Date: Tue, 24 Mar 2020 17:18:29 -0400 [thread overview]
Message-ID: <20200324211829.GB18421@fieldses.org> (raw)
In-Reply-To: <20200318104031.289921-1-tigran.mkrtchyan@desy.de>
Applied.--b.
On Wed, Mar 18, 2020 at 11:40:31AM +0100, Tigran Mkrtchyan wrote:
> fix back channel ping from server
> ---
> rpc/rpc.py | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/rpc/rpc.py b/rpc/rpc.py
> index c536384..d15cf06 100644
> --- a/rpc/rpc.py
> +++ b/rpc/rpc.py
> @@ -693,8 +693,11 @@ class ConnectionHandler(object):
> status, result, notify = tuple
> if result is None:
> result = b''
> + if isinstance(result, str):
> + result = bytes(result, encoding='UTF-8')
> +
> if not isinstance(result, bytes):
> - raise TypeError("Expected string")
> + raise TypeError("Expected bytes, got %s" % type(result))
> # status, result = method(msg_data, call_info)
> log_t.debug("Called method, got %r, %r" % (status, result))
> except rpclib.RPCDrop:
> --
> 2.25.1
prev parent reply other threads:[~2020-03-24 21:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-18 10:40 [PATCH] rpc: fix str to bytes conversion Tigran Mkrtchyan
2020-03-24 21:18 ` J. Bruce Fields [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200324211829.GB18421@fieldses.org \
--to=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
--cc=tigran.mkrtchyan@desy.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).