title: TypeError: expected a character buffer object
body: <p>I am running into the following error while writing the value into a file. Can you please help me figure out what is the issue here and how to fix it? </p>
  
  <pre><code>row = 649
  with open(r'\\loc\dev\Build_ver\build_ver.txt','r+') as f:
      f.write(row)
  print row
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>Traceback (most recent call last):
    File "latest_rev.py", line 6, in &lt;module&gt;
      f.write(row)
  TypeError: expected a character buffer object
  </code></pre>