Merge pull request #5916 from leifurhauks/py3_str_bytes_in_links_service_and_beta_server

Python 3: fix a bytes/str runtime issue
pull/5660/head
Jan Tattermusch 9 years ago
commit df7e4228df
  1. 4
      src/python/grpcio/grpc/_links/service.py
  2. 4
      src/python/grpcio/grpc/beta/_server.py

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -177,7 +177,7 @@ class _Kernel(object):
call = service_acceptance.call call = service_acceptance.call
call.accept(self._completion_queue, call) call.accept(self._completion_queue, call)
try: try:
group, method = service_acceptance.method.split('/')[1:3] group, method = service_acceptance.method.split(b'/')[1:3]
except ValueError: except ValueError:
logging.info('Illegal path "%s"!', service_acceptance.method) logging.info('Illegal path "%s"!', service_acceptance.method)
return return

@ -1,4 +1,4 @@
# Copyright 2015, Google Inc. # Copyright 2015-2016, Google Inc.
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # 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: if e.code is None and e.details is None:
raise base.NoSuchMethodError( raise base.NoSuchMethodError(
interfaces.StatusCode.UNIMPLEMENTED, interfaces.StatusCode.UNIMPLEMENTED,
b'Method "%s" of service "%s" not implemented!' % (method, group)) 'Method "%s" of service "%s" not implemented!' % (method, group))
else: else:
raise raise

Loading…
Cancel
Save