title: Base64 Decode : Specific String Incorrect Padding (with correct padding)
body: <p>I am trying to Base64 decode a string (into bytes) using Python's base64.b64decode(str) method:</p>
  <blockquote>
  <p>46oWrWpy2gTEGwNnN6Ayy</p>
  </blockquote>
  <p>and I am ensuring it has a multiple of 4 ='s for padding or out of frustration any of these:</p>
  <blockquote>
  <p>46oWrWpy2gTEGwNnN6Ayy=</p>
  <p>46oWrWpy2gTEGwNnN6Ayy==</p>
  <p>46oWrWpy2gTEGwNnN6Ayy===</p>
  <p>46oWrWpy2gTEGwNnN6Ayy==================================================</p>
  </blockquote>
  <p>and yet I still get &quot;Incorrect Padding&quot; on Python v3.6.1. Other strings are fine.</p>
  <p>I show a colleague, he tries on Python 2 and observes the same response.</p>
  <p>I note removing the first &quot;4&quot; is enough to ensure the Base64 decode works.</p>
  <p>I have skim read <a href="https://docs.python.org/3/library/base64.html" rel="nofollow noreferrer">Python's docs</a> (noting casefold doesn't apply for Base64) and haven't yet ventured further into <a href="https://www.rfc-editor.org/rfc/rfc3548.html" rel="nofollow noreferrer">RFC3548</a> but wondered if someone else had encountered something similar before. Anyone have any clues :)? Surely this can't be a bug in Python's Base64 decoder?</p>