title: Python protobuf decode base64 string
body: <p>I am trying to get JSON data from encrypted base64 string. I have created my proto file like below</p>
  <pre><code>syntax = &quot;proto2&quot;;
  
  message ArtifactList {
      repeated Artifact artifacts = 1;
  }
  
  message Artifact {
      required string id = 1;
      required uint64 type_id = 2;
      required string uri = 3;
  }
  </code></pre>
  <p>After that, I have generated python files using the proto command. I am trying to decrypt the base64 string like below.</p>
  <pre><code>import message_pb2
  
  import base64
  data = base64.b64decode(&quot;AAAAAA8KDQgTEBUgBCjln62lxS6AAAAAD2dycGMtc3RhdHVzOjANCg==&quot;)
  
  s = str(data)
  message_pb2.ArtifactList.ParseFromString(s)
  </code></pre>
  <p>But I am getting the below error.</p>
  <pre><code>Traceback (most recent call last):
    File &quot;app.py&quot;, line 7, in &lt;module&gt;
      message_pb2.ArtifactList.ParseFromString(s)
  TypeError: descriptor 'ParseFromString' requires a 'google.protobuf.pyext._message.CMessage' object but received a 'str'
  </code></pre>
  <p>I am a newbie for protobuf. I couldn't find a solution to fix this issue.</p>
  <p>Could anyone help to fix this problem?</p>
  <p>Thanks in advance.</p>