5-Python-Projects-For-Beginners icon indicating copy to clipboard operation
5-Python-Projects-For-Beginners copied to clipboard

fernet value error

Open samthebutchr12 opened this issue 3 years ago • 1 comments

Traceback (most recent call last): File "C:\Users"username"\PycharmProjects\FreeCodeCamp\mini projects\git_PW_manager.py", line 18, in fer = Fernet(code) File "C:\Users"username\PycharmProjects\FreeCodeCamp\venv\lib\site-packages\cryptography\fernet.py", line 39, in init raise ValueError( ValueError: Fernet key must be 32 url-safe base64-encoded bytes.

line 18 in PW manager: fer = Fernet(key)

line 39 in fernet: raise ValueError( "Fernet key must be 32 url-safe base64-encoded bytes." )

I am using Pycharm

samthebutchr12 avatar Aug 25 '22 17:08 samthebutchr12

@samthebutchr12 hey buddy, Tim actually ran the write_key() function once (to get he key.key file) and then that block of code was of no use, so he placed it as a comment. So to fix your issue, you need to remove those quotation marks ( ''' ) from the start and beginning of that block of code, you will be fine. If you run to another error, I will try my best to help !

rewaj56 avatar Dec 10 '22 09:12 rewaj56