TypeError: 'str' does not support the buffer interface Py2 to Py3
<p>I have a program written in Python 2 which I would like to get running for Python 3. I'm getting</p>

<blockquote>
  <p>TypeError: 'str' does not support the buffer interface</p>
</blockquote>

<p>on the following code:</p>

<pre><code>_head = _head.rstrip('\0').upper()
</code></pre>

<p>I believe I understand the main reason for the error, however none of the solutions I found here so far worked for me. The outcome of all this is <code>b'variable'</code>, which messes up the rest of the program. The outcome in Python 2 is just <code>variable</code>. Can I get the same result in Python 3?</p>