title: Python 3 incorrectly converting "0x0000" string into hex
body: <p>I am pulling data from a database, and one of the columns constantly has hex data starting with &quot;0x&quot;. The end goal is to simply write all the data from this table into a pipe delimited file that is read by another system. naturally, this triggers Python to think its a hex value and tries to convert it. Here is a snippet of my code.</p>
  <pre><code>for row in cur.execute(sql):
      for x in range(len(row)):
                      
                      if(str(row[x]) is None or str(row[x])=='None'):
                          row[x]=&quot;&quot;
                      if(len(row)-1==x):
                         
                          f.write(str(row[x]))
                      else:
                          f.write(str(row[x])+&quot;|&quot;)
  
  </code></pre>
  <p>row[x] can be an int, string, datetime, etc..  The str() converts it into a string, but when it hits a cell that contains &quot;0x0000&quot; it converts the hex into b'\x00\x00'.  I want the value to simply show &quot;0x0000&quot;. The data is being stored in the database as varbinary.</p>