aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio/grpc/beta
diff options
context:
space:
mode:
authorGravatar Leifur Halldor Asgeirsson <lasgeirsson@zerofail.com>2016-03-22 14:22:46 -0400
committerGravatar Leif Halldor Asgeirsson <leifur@leifur.ca>2016-03-22 20:52:37 -0400
commitb9501bcb0bdbef7bbf788ffe3ea66208dd02e24f (patch)
treeda4cce26ba0b3c6d6aa2103624ba2bb6d565266d /src/python/grpcio/grpc/beta
parent39fd22193bedbef97412c857c2d2f73eb5752d2c (diff)
Python 3: fix a bytes/str runtime issue
On python3, in grpc._links.service._Kernel._on_service_acceptance_event, there is a runtime TypeError: ``` _on_service_acceptance_event group, method = service_acceptance.method.split('/')[1:3] TypeError: 'str' does not support the buffer interface ``` It is fixed by using a bytes literal (`b'/'`) instead of a string literal. This exposed another issue in grpc.beta._server where an exception was being raised with a bytes literal for a message (a string should be used instead.)
Diffstat (limited to 'src/python/grpcio/grpc/beta')
-rw-r--r--src/python/grpcio/grpc/beta/_server.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/python/grpcio/grpc/beta/_server.py b/src/python/grpcio/grpc/beta/_server.py
index 2b520cc7e5..12d16e6c18 100644
--- a/src/python/grpcio/grpc/beta/_server.py
+++ b/src/python/grpcio/grpc/beta/_server.py
@@ -1,4 +1,4 @@
-# Copyright 2015, Google Inc.
+# Copyright 2015-2016, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -62,7 +62,7 @@ class _GRPCServicer(base.Servicer):
if e.code is None and e.details is None:
raise base.NoSuchMethodError(
interfaces.StatusCode.UNIMPLEMENTED,
- b'Method "%s" of service "%s" not implemented!' % (method, group))
+ 'Method "%s" of service "%s" not implemented!' % (method, group))
else:
raise