title: Python3 hashing gives different result
body: <p>I try to calculate  sha1 for encrypted file (file.gpg) using Python3 code. </p>
  
  <p>I test two func.</p>
  
  <pre class="lang-py prettyprint-override"><code>import hashlib
  import gnupg
  
  def sha1sum(filename):
      h  = hashlib.sha1()
      b  = bytearray(128*1024)
      mv = memoryview(b)
      with open(filename, 'rb', buffering=0) as f:
          for n in iter(lambda : f.readinto(mv), 0):
              h.update(mv[:n])
      return h.hexdigest()
  
  
  def sha1_checksum(filename, block_size=65536):
      sha1 = hashlib.sha1()
      with open(filename, 'rb') as f:
          for block in iter(lambda: f.read(block_size), b''):
              sha1.update(block)
      return sha1.hexdigest()
  
  original = open('file.bin', 'rb')
  
  gpg = gnupg.GPG()
  gpg.encoding = 'utf-8'
  encrypt = gpg.encrypt_file(original, 
                             recipients=None, 
                             passphrase=password,
                             symmetric='AES256', 
                             output=file)
  
  sum = sha1sum(file)
  sum = sha1_checksum(file)
  </code></pre>
  
  <p>First start of the script</p>
  
  <pre class="lang-py prettyprint-override"><code>697cee13eb4c91f41922472d8768fad076c72166
  697cee13eb4c91f41922472d8768fad076c72166
  </code></pre>
  
  <p>Second start of the script </p>
  
  <pre class="lang-py prettyprint-override"><code>a95593f0d8ce274492862b58108a20700ecf9d2b
  a95593f0d8ce274492862b58108a20700ecf9d2b
  </code></pre>
  
  <p>Does sha1sum() or sha1_checksum() wrong?</p>
  
  <p>Or file encryption gives different file.gpg ?</p>