Hello Everyone. 

I am trying to decode previously encoded and stored in mysql but ending up 
with binascii.Error: Incorrect padding error. I have been using sqllite for 
a while with same functionality used to work . When I changed to mysql it 
broke things . Any help with it is much appreciated. 


>>> dbins.user_pass
*"b'ZWJzMTJndTFTJEhANUg=\\n'"*

>>> base64.decodebytes(dbins.user_pass)
Traceback (most recent call last):
  File "D:\Development\sss\pyenv\lib\base64.py", line 517, in 
_input_type_check
    m = memoryview(s)
TypeError: memoryview: a bytes-like object is required, not 'str'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "D:\Development\sss\pyenv\lib\base64.py", line 552, in decodebytes
    _input_type_check(s)
  File "D:\Development\sss\pyenv\lib\base64.py", line 520, in 
_input_type_check
    raise TypeError(msg) from err
TypeError: expected bytes-like object, not str

>>> base64.decodebytes(dbins.user_pass.encode("utf-8"))
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "D:\Development\sss\pyenv\lib\base64.py", line 553, in decodebytes
    return binascii.a2b_base64(s)
*binascii.Error: Incorrect padding*

Thanks,
Uday.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ffe9a87d-9c06-48af-a943-593d2879a00e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to