title: What is the difference between rb and r+b modes in file objects
body: <p>I am using pickle module in Python and trying different file IO modes:</p>
  
  <pre><code># works on windows.. "rb"
  with open(pickle_f, 'rb') as fhand:
          obj = pickle.load(fhand)
  
  # works on linux.. "r"
  with open(pickle_f, 'r') as fhand:
          obj = pickle.load(fhand)
  
  # works on both "r+b"
  with open(pickle_f, 'r+b') as fhand:
          obj = pickle.load(fhand)
  </code></pre>
  
  <p>I never read about "r+b" mode anywhere, but found mentioning about it in the <a href="http://docs.python.org/2/tutorial/inputoutput.html" rel="noreferrer">documentation</a>.</p>
  
  <p>I am getting <code>EOFError</code> on Linux if I use <code>"rb"</code> mode and on Windows if <code>"r"</code> is used. I just gave <code>"r+b"</code> mode a shot and it's working on both.</p>
  
  <p>What's <code>"r+b"</code> mode? What's the difference between "rb" and "r+b"? Why does it work when the others don't?</p>