title: Can not seek into a file using 1 in the [whence] part and write something simultaneously
body: <p>When I open a file using the following code:</p>
  <pre><code>n_val = &quot;Good Bad&quot;
  open = testfile.py
  outputFile=open(outFile,&quot;r+&quot;)
  outputFile.read(1)
  outputFile.read(1)
  outputFile.seek(-1,1)
  outputFile.write(n_val)
  </code></pre>
  <p>then the following gives error:
  outputFile.seek(-1,1)
  io.UnsupportedOperation: can't do nonzero cur-relative seeks</p>
  <p>But when I open the file using the following code:</p>
  <pre><code>n_val = &quot;Good Bad&quot;
  open = testfile.py
  outputFile=open(outFile,&quot;br+&quot;) //I just open the file in binary mode
  outputFile.read(1)
  outputFile.read(1)
  outputFile.seek(-1,1)
  outputFile.write(n_val)   
  </code></pre>
  <p>then the following gives error:
  outputFile.write(n_val)<br />
  TypeError: 'str' does not support the buffer interface</p>
  <p>Please give me a solution where I can use both the functions as to seek at a given condition and then write something to the file opened.</p>