title: Python: Decoding base64 encoded strings
body: <p>I'm new to python and have a question about decoding base64 encoded urls:  </p>
  
  <pre><code>import base64
  url64="aHR0cDovLzR1ZnJlZS50ay9tZWRpYTcyMzY0Ni9mdWVuZi8wMzYubXAzA"
  finalUrl=base64.b64decode(url64)
  </code></pre>
  
  <p>Won't work! TypeError: Incorrect padding</p>
  
  <p>I've also tried to add the needed padding:  </p>
  
  <pre><code>import base64
  url64="aHR0cDovLzR1ZnJlZS50ay9tZWRpYTcyMzY0Ni9mdWVuZi8wMzYubXAzA"
  finalUrl=base64.b64decode(url64 + '=' * (4 - len(url64) % 4))
  </code></pre>
  
  <p>but im still getting TypeError: Incorrect padding</p>
  
  <p>Would be great if someone knows a solution for this.</p>