Skip to content
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

ValueError: level must be >= 0 #10

Closed
mpwoodward opened this issue Oct 31, 2014 · 1 comment
Closed

ValueError: level must be >= 0 #10

mpwoodward opened this issue Oct 31, 2014 · 1 comment

Comments

@mpwoodward
Copy link

I'm new to pgcrypto so forgive me if this isn't an issue per se (it's entirely possible and highly likely I'm missing a piece of the configuration puzzle), but I didn't see another appropriate place to discuss what I'm running into.

I'm using python 3.4 and postgres 9.3.5 on Ubuntu and on the postgres side anyway everything seems to be functioning, meaning CREATE EXTENSION worked and I can verify version 1.0 is installed, and manual queries in psql doing some crypt stuff work fine.

When I try to do anything from Django I get the following error:
File "/vagrant/foo/security/models.py", line 9, in Bar
bar = pgcrypto.EncryptedTextField()
File "/usr/local/lib/python3.4/dist-packages/pgcrypto.py", line 168, in init
mod = import('Crypto.Cipher', globals(), locals(), [cipher_name], -1)
ValueError: level must be >= 0

I've tried both using models as well as just going into a shell and creating instances of the encrypted field types and always get that same last two lines in the error message.

Any guidance would be greatly appreciated. Thanks.

@dcwatson
Copy link
Owner

This has been fixed since ea7098f - which version of pgcrypto are you using? Can you try the latest master? I'll push out 1.2.1 in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants