-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: string argument without an encoding #16
Comments
EDIT: Figured it out, I'm a dope and never ran migrations |
Also getting the same error. I was able to get it to properly encrypt the field in my database but in my admin it is giving me the same error. I also ran makemigrations and migrate but still no luck. After importing into my models.py file -> import fernet_fields as fields, as soon as I add fields.EncryptedCharField to my model class's field it gives me a problem in my admin for that model. |
Has anyone found a solution for this? |
I'm also getting this issue in Django 3.0 and Python 3.8 |
Im also getting this in fernet. Is this a python bug though its very random |
For me the issue was that I had some values for the same column that were non encrypted. The error was fixed after dropping the column and re-creating it with empty values. Luckly the project wasn't in production. |
I have the same problem. Has anyone found a solution for this? |
It seems like this randomly affects systems without a clear pattern, although systems setup cleanly from scratch did not yet show this behavior (in this case, the clean setup happens with The only factor for confusion might be django-fernet-fields/fernet_fields/fields.py Lines 79 to 90 in 8f8cadb
EncryptedTextField definitions, this will temporarily switch the internal field type to the actually breaking TextField we observed; this seems to indicate that under some circumstances, Django and its migration process access the validators and get confused, thus wrongly creating a TextField instead of a BinaryField . Commenting this method/property seems to still let the tests pass, thus I am not sure whether this is still required at all anymore.
|
I am experiencing the error indicated in the title. I am running Python 3.6.5 and am using the EncryptedCharField. Django 2.0
/venv/lib/python3.6/site-packages/fernet_fields/fields.py", line 76, in from_db_value value = bytes(value) TypeError: string argument without an encoding
Likely related to this? https://stackoverflow.com/a/37601966/5331935
The text was updated successfully, but these errors were encountered: