title: Writing a base64 string to file in python not working
body: <p>I am getting a base64 encoded string from a POST request. I wanted to store it in my filesystem at a particular location after decoding . So i have written this code,</p>
  
  <pre><code>try:
     file_content=base64.b64decode(file_content)
     with open("/data/q1.txt","w") as f:
          f.write(file_content)
  except Exception as e:
     print(str(e))
  </code></pre>
  
  <p>This is creating the file at /data/ but the file is empty. It is not containing the decoded string. There is no permission issue.
  But when i am instead of file_content writing 'Hello World' to the file. It is working. Why python is not able to write base64 decoded string to the file? It is not throwing any exception also. Is there something i need to take care when dealing with base64 format?       </p>