-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 1 Oct 2010, at 17:06, Diez B. Roggisch wrote:
Your problem is that you don't use unicode objects, but instead pass
strings. That's the reason for the warning.
That's what I thought, at first but inspecting the code, I came to the
conclusion that it's a red herring.
I think the OP is correct and the docstring is /in/correct in
declaring the fields to be of type Unicode().
The PyCrypto API asserts that Blowfish.new() returns "a new Blowfish
object" but fails to mention that the "object" is actually a string.
I can't even get the Blowfish cipher to function at all with unicode
strings:
>>> from Crypto.Cipher import Blowfish
>>> password = u'Στράτος'
>>> type(password)
<type 'unicode'>
>>> x = Blowfish.new('a secret', Blowfish.MODE_CFB).encrypt(password)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode characters in position
0-6: ordinal not in range(128)
I guess the Blowfish API only accepts and returns strings, so the OP's
workaround seems correct.
- --
Cheers,
Graham
http://www.linkedin.com/in/ghiggins
-----BEGIN PGP SIGNATURE-----
iEUEARECAAYFAkymFi0ACgkQOsmLt1NhivzMXgCYyc4g2qrz4NOkuaXtOFTe7sti
TACeIhQyKnvkaZ0MmVExsmaU+dSrH72JAJUCBQFMphYtWetZVntpcPUBAj8IA/9F
cfZquGZ2ffS7qWKNvBL7GTas5gHYQGjgMuH1vMC5JhpNpfgZcjocpiSwkJanfRqT
UxRej7xMjdLMkQUertpW7tcz9NiDwXpUF8EfT++gZlPnFTd1oasE0UBoNwajUEtK
xENlwEkUDTF0/padGHY4bQ6U+fU7sIB42WMbTc1fDg==
=GdXB
-----END PGP SIGNATURE-----
--
You received this message because you are subscribed to the Google Groups
"SQLElixir" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sqlelixir?hl=en.