Python 3.9 "AttributeError: module 'base64' has no attribute 'decodestring'"
rollbrettler opened this issue · 2 comments
Hey, I recently tried this project on debian testing, which is using python 3.9. Unfortunately i get the following error.
Traceback (most recent call last):
File "/usr/local/bin/ssh-ldap-pubkey", line 144, in <module>
main(**kwargs)
File "/usr/local/bin/ssh-ldap-pubkey", line 114, in main
ldapssh.add_pubkey(login, passw, pubkey)
File "/usr/local/lib/python3.9/dist-packages/ssh_ldap_pubkey/__init__.py", line 146, in add_pubkey
if not is_valid_openssh_pubkey(pubkey):
File "/usr/local/lib/python3.9/dist-packages/ssh_ldap_pubkey/__init__.py", line 43, in is_valid_openssh_pubkey
data = base64.decodestring(data64)
According to the release notes for 3.9 (https://docs.python.org/3/whatsnew/3.9.html) it should be now base64.decodestring()
base64.encodestring() and base64.decodestring(), aliases deprecated since Python 3.1, have been removed: use base64.encodebytes() and base64.decodebytes() instead. (Contributed by Victor Stinner in bpo-39351.)
base64.decodestring()
is in python since 3.1. Do you think it is as simple as change the method name or what would be the minimum python version to support?
I just ran into the exact same issue and wrote a similar patch that I wanted to submit, only to see that a fix has been around for many months. It would really be greeat if #50 could be merged to avoid even more people running into the same problem.
It's an almost trivial fix, so there shouldn't be much controversy around merging it. Thanks!
Yes we need this pull request merged please broken on new systems