DailyNotes
DailyNotes copied to clipboard
Fix py3 encodings
I resolved some minor string handling that was causing trace backs to be thrown. I reformatted the code to be pep8 compliant too. Since I was submitting this PR, I also swapped the now unmaintained 'pycrypto' for the drop-in replacement, 'pycryptodome'.
Thanks for submitting a PR :slightly_smiling_face:
Does this maintain compatibility with Python 2? If not, could you also update the readme?
Also I know PEP8 prefers 4 spaces, but it's too ugly for me. I'd prefer 2 spaces - easier to see what else has changed too :)
@patchedsoul do you mind responding?
Is there any progress here? I am having the same issue.
@m0ngr31 is there a workaround?
Also wondering if there is a workaround. I can't get the app to work at all using the provided docker-compose.
Tagging: @m0ngr31
ValueError: IV must be 16 bytes long
server_1 | [2023-02-07 14:41:26,975] ERROR in app: Exception on /api/save_day [PUT]
server_1 | Traceback (most recent call last):
server_1 | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 2525, in wsgi_app
server_1 | response = self.full_dispatch_request()
server_1 | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1822, in full_dispatch_request
server_1 | rv = self.handle_user_exception(e)
server_1 | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1820, in full_dispatch_request
server_1 | rv = self.dispatch_request()
server_1 | File "/usr/local/lib/python3.8/site-packages/flask/app.py", line 1796, in dispatch_request
server_1 | return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
server_1 | File "/usr/local/lib/python3.8/site-packages/flask_jwt_extended/view_decorators.py", line 154, in decorator
server_1 | return current_app.ensure_sync(fn)(*args, **kwargs)
server_1 | File "/app/app/routes.py", line 73, in save_day
server_1 | enc_date = aes_encrypt(title)
server_1 | File "/app/app/models.py", line 18, in aes_encrypt
server_1 | cipher = AES.new(key, AES.MODE_CFB, key[::-1])
server_1 | File "/usr/local/lib/python3.8/site-packages/Crypto/Cipher/AES.py", line 95, in new
server_1 | return AESCipher(key, *args, **kwargs)
server_1 | File "/usr/local/lib/python3.8/site-packages/Crypto/Cipher/AES.py", line 59, in __init__
server_1 | blockalgo.BlockAlgo.__init__(self, _AES, key, *args, **kwargs)
server_1 | File "/usr/local/lib/python3.8/site-packages/Crypto/Cipher/blockalgo.py", line 141, in __init__
server_1 | self._cipher = factory.new(key, *args, **kwargs)