Bug #49916
python 3.9 : module 'base64' has no attribute 'encodestring'
Début:
06 janvier 2021
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
En faisant tourner les tests sur une machine trop récente (python 3.9) :
passerelle/apps/cartads_cs/models.py:199: in update_data_cache resp = client.service.GetCommunes(self.get_token(), {}) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <CartaDSCS: Test> def get_token(self): token_data = { 'date': datetime.datetime.now().strftime('%d/%m/%Y %H:%M:%S'), 'login': self.username, 'password': self.password, } if self.client_name: token_data['client'] = self.client_name token_data_str = json.dumps(token_data) data_pad = AES.block_size - len(token_data_str) % AES.block_size aes = AES.new(self.secret_key, AES.MODE_CBC, self.iv) token = aes.encrypt(token_data_str + (chr(data_pad)*data_pad)) > return force_text(base64.encodestring(token)).replace('\n', '').rstrip('=') E AttributeError: module 'base64' has no attribute 'encodestring'
... il faut sans doute passer par encodebytes
Fichiers
Révisions associées
Historique
Mis à jour par Thomas Noël il y a plus de 3 ans
- Fichier 0001-cartads_cs-replace-deprecated-base64.encodestring-wi.patch 0001-cartads_cs-replace-deprecated-base64.encodestring-wi.patch ajouté
- Tracker changé de Support à Bug
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Frédéric Péters il y a environ 3 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Thomas Noël il y a environ 3 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit e8870d6b9708843768f2a002aab2e34d35e115c9 Author: Thomas NOEL <tnoel@entrouvert.com> Date: Wed Jan 6 15:12:51 2021 +0100 cartads_cs: replace deprecated base64.encodestring with encodebytes (#49916)
Mis à jour par Frédéric Péters il y a environ 3 ans
- Statut changé de Résolu (à déployer) à Solution déployée
cartads_cs: replace deprecated base64.encodestring with encodebytes (#49916)