diff --git a/src/python/pants/backend/jvm/tasks/bootstrap_jvm_tools.py b/src/python/pants/backend/jvm/tasks/bootstrap_jvm_tools.py index e438f89d197..77009a4acb9 100644 --- a/src/python/pants/backend/jvm/tasks/bootstrap_jvm_tools.py +++ b/src/python/pants/backend/jvm/tasks/bootstrap_jvm_tools.py @@ -46,15 +46,15 @@ def compute_fingerprint(self, target): if base_fingerprint is None: return None - hasher.update('version=2') + hasher.update(b'version=2') hasher.update(base_fingerprint.encode('utf-8')) # NB: this series of updates must always cover the same fields that populate `_tuple`'s slots # to ensure proper invalidation. - hasher.update(self._main) + hasher.update(self._main.encode('utf-8')) if self._custom_rules: for rule in self._custom_rules: - hasher.update(rule.render()) + hasher.update(rule.render().encode('utf-8')) return hasher.hexdigest() if PY3 else hasher.hexdigest().decode('utf-8') diff --git a/tests/python/pants_test/backend/codegen/protobuf/java/test_protobuf_integration.py b/tests/python/pants_test/backend/codegen/protobuf/java/test_protobuf_integration.py index 8d2041fd133..4c1c944cfa7 100644 --- a/tests/python/pants_test/backend/codegen/protobuf/java/test_protobuf_integration.py +++ b/tests/python/pants_test/backend/codegen/protobuf/java/test_protobuf_integration.py @@ -35,7 +35,7 @@ def test_bundle_protobuf_normal(self): stdout=subprocess.PIPE, cwd=out_path) java_retcode = java_run.wait() - java_out = java_run.stdout.read() + java_out = java_run.stdout.read().decode('utf-8') self.assertEqual(java_retcode, 0) self.assertIn("parsec", java_out) @@ -54,7 +54,7 @@ def test_bundle_protobuf_imports(self): stdout=subprocess.PIPE, cwd=out_path) java_retcode = java_run.wait() - java_out = java_run.stdout.read() + java_out = java_run.stdout.read().decode('utf-8') self.assertEqual(java_retcode, 0) self.assertIn("very test", java_out) @@ -76,7 +76,7 @@ def test_bundle_protobuf_unpacked_jars(self): 'org.pantsbuild.example.protobuf.unpacked_jars.ExampleProtobufExternalArchive'] java_run = subprocess.Popen(args, stdout=subprocess.PIPE, cwd=out_path) java_retcode = java_run.wait() - java_out = java_run.stdout.read() + java_out = java_run.stdout.read().decode('utf-8') self.assertEqual(java_retcode, 0) self.assertIn("Message is: Hello World!", java_out) diff --git a/tests/python/pants_test/backend/codegen/thrift/python/test_apache_thrift_py_gen.py b/tests/python/pants_test/backend/codegen/thrift/python/test_apache_thrift_py_gen.py index 9bd2fbc151c..789db883445 100644 --- a/tests/python/pants_test/backend/codegen/thrift/python/test_apache_thrift_py_gen.py +++ b/tests/python/pants_test/backend/codegen/thrift/python/test_apache_thrift_py_gen.py @@ -154,7 +154,7 @@ def test_namespace_effective(self): # TODO(John Sirois): We really should be emitting setuptools in a # `synthetic_target_extra_dependencies` override in `ApacheThriftPyGen`: # https://github.com/pantsbuild/pants/issues/5975 - pythonpath = interpreter.extras.values() + pythonpath = list(interpreter.extras.values()) pythonpath.extend(os.path.join(get_buildroot(), t.target_base) for t in targets) for dist in resolve(['thrift=={}'.format(self.get_thrift_version(apache_thrift_gen))], interpreter=interpreter, diff --git a/tests/python/pants_test/backend/codegen/wire/java/test_wire_integration.py b/tests/python/pants_test/backend/codegen/wire/java/test_wire_integration.py index 5e3c1dc8786..d22f8bc98a2 100644 --- a/tests/python/pants_test/backend/codegen/wire/java/test_wire_integration.py +++ b/tests/python/pants_test/backend/codegen/wire/java/test_wire_integration.py @@ -46,7 +46,7 @@ def test_bundle_wire_normal(self): 'org.pantsbuild.example.wire.temperatureservice.WireTemperatureExample'] java_run = subprocess.Popen(args, stdout=subprocess.PIPE, cwd=out_path) java_retcode = java_run.wait() - java_out = java_run.stdout.read() + java_out = java_run.stdout.read().decode('utf-8') self.assertEqual(java_retcode, 0) self.assertIn('19 degrees celsius', java_out) @@ -63,7 +63,7 @@ def test_bundle_wire_dependent_targets(self): stdout=subprocess.PIPE, cwd=out_path) java_retcode = java_run.wait() - java_out = java_run.stdout.read() + java_out = java_run.stdout.read().decode('utf-8') self.assertEqual(java_retcode, 0) self.assertIn('Element{symbol=Hg, name=Mercury, atomic_number=80, ' 'melting_point=Temperature{unit=celsius, number=-39}, '