Skip to content
Closed
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
2 changes: 2 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def _python_deps():
_repository_impl(
name = "com_github_twitter_common_rpc",
build_file = "@envoy//bazel/external:twitter_common_rpc.BUILD",
patch_args = ["-p2"],
patches = ["@envoy//bazel:twitter_common_rpc.patch"],
)
_repository_impl(
name = "com_github_twitter_common_finagle_thrift",
Expand Down
33 changes: 33 additions & 0 deletions bazel/twitter_common_rpc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff -Naur twitter.common.rpc-0.3.9/src/twitter/common/rpc/address.py twitter.common.rpc-0.3.9-new/src/twitter/common/rpc/address.py
--- a/src/twitter/common/rpc/address.py 2015-12-08 04:58:41.000000000 +0000
+++ b/src/twitter/common/rpc/address.py 2020-04-08 16:16:56.000000000 +0000
@@ -8,7 +8,7 @@
def sanity_check(host, port):
if not isinstance(host, Compatibility.string):
raise Address.InvalidFormat('Host must be a string, got %s' % host)
- if not isinstance(port, (int, long)):
+ if not isinstance(port, int):
raise Address.InvalidFormat('Port must be an integer, got %s' % port)
if port <= 0:
raise Address.InvalidFormat('Port must be a positive integer, got %s' % port)
@@ -29,7 +29,7 @@
@staticmethod
def from_pair(*args, **kw):
if (kw or len(args) != 2 or not isinstance(args[0], Compatibility.string)
- or not isinstance(args[1], (int, long))):
+ or not isinstance(args[1], int)):
raise Address.InvalidFormat('from_pair expects host, port as input!')
Address.sanity_check(args[0], args[1])
return Address(args[0], args[1])
diff -Naur twitter.common.rpc-0.3.9/src/twitter/common/rpc/finagle/trace.py twitter.common.rpc-0.3.9-new/src/twitter/common/rpc/finagle/trace.py
--- a/src/twitter/common/rpc/finagle/trace.py 2015-12-08 04:58:41.000000000 +0000
+++ b/src/twitter/common/rpc/finagle/trace.py 2020-04-08 16:17:11.000000000 +0000
@@ -33,7 +33,7 @@
if isinstance(value, str):
if SpanId.HEX_REGEX.match(value):
return SpanId(int(value, 16))
- elif isinstance(value, (int, long)):
+ elif isinstance(value, int):
return SpanId(value)
elif isinstance(value, SpanId):
return SpanId(value.value)
4 changes: 2 additions & 2 deletions test/extensions/filters/network/thrift_proxy/driver/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ filegroup(
py_binary(
name = "client",
srcs = ["client.py"],
python_version = "PY2",
python_version = "PY3",
deps = [
"//test/extensions/filters/network/thrift_proxy/driver/fbthrift:fbthrift_lib",
"//test/extensions/filters/network/thrift_proxy/driver/finagle:finagle_lib",
Expand All @@ -28,7 +28,7 @@ py_binary(
py_binary(
name = "server",
srcs = ["server.py"],
python_version = "PY2",
python_version = "PY3",
deps = [
"//test/extensions/filters/network/thrift_proxy/driver/fbthrift:fbthrift_lib",
"//test/extensions/filters/network/thrift_proxy/driver/finagle:finagle_lib",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@

set -e

# enable utf-8 in python
LANG=$(locale -a | grep -i -E "^(en_US|C)\.(utf-?8)$" | sort -r | head -n 1)
if [[ -z "$LANG" ]]; then
LANG="C.UTF-8"
fi
export LANG

function usage() {
echo "Usage: $0 <mode> <transport> <protocol> -s [multiplex-service] -H [headers] method [param...]"
echo "where mode is success, exception, or idl-exception"
Expand Down