Created
September 25, 2018 02:23
-
-
Save joshkel/36183faee736400c0fe1e863867e15ef to your computer and use it in GitHub Desktop.
Revisions
-
joshkel created this gist
Sep 25, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ #!/usr/bin/env python3 # Test file demonstrating issues from # https://github.com/protocolbuffers/protobuf/pull/5166 # Try running with PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python # and with PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp import subprocess proto_definition = """ syntax = "proto2"; message TestMessage { optional int32 value = 1; } """ with open('test.proto', 'w') as f: f.write(proto_definition) subprocess.check_call(['protoc', '--python_out=.', 'test.proto']) import test_pb2 # noqa test_message = test_pb2.TestMessage() print(test_message.ParseFromString(b'test'))