title: binary file dumped by list of pickled bytes has inconsistent line number
body: <p>The following code attempts to write a bytes created by <code>pickle.dumps</code> line by line. In the following example, we create 3 byte object from numpy's random array line by line, so the resulting binary file is supposed to have 3 lines.</p>
  <p>The following code finally prints number of lines of the binary file by <code>print(len(lines))</code>. Contrary to my expectation, the printed line number was <code>5</code>. (One can check by opening the binary via text editor actually).</p>
  <p>Why does such thing occur?</p>
  <pre class="lang-py prettyprint-override"><code>import pickle
  import numpy as np
  from typing import List
  
  np.random.seed(1)
  data_list = [np.random.randn(s, s) for s in [2, 3, 4]]
  
  print(&quot;writing...&quot;)
  with open('tmp', 'wb') as f:
      for data in data_list:
          byte = pickle.dumps(data)
          f.write(byte + b'\n')
          
  print(&quot;reading...&quot;)
  f = open('tmp', 'rb')
  lines = f.readlines()
  print(len(lines))
  f.close()
  </code></pre>