Skip to content

Commit

Permalink
Fix USE_ENCRYPTION=false in python3
Browse files Browse the repository at this point in the history
  • Loading branch information
asottile committed Sep 23, 2019
1 parent 3f04568 commit 108a39b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion confidant/ciphermanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ def encrypt(self, raw):
logging.warning('Not using encryption in CipherManager.encrypt'
' If you are not running in a development or test'
' environment, this should not be happening!')
return 'DANGER_NOT_ENCRYPTED_{0}'.format(base64.b64encode(raw))
return 'DANGER_NOT_ENCRYPTED_{0}'.format(
base64.b64encode(raw.encode('UTF-8')).decode('UTF-8'),
)
if self.version == 2:
f = Fernet(self.key)
return f.encrypt(raw.encode('utf-8')).decode('UTF-8')
Expand Down

0 comments on commit 108a39b

Please sign in to comment.