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

In Python2, passing a unicode object to execute() results in an exception #149

Open
madscientist opened this issue Oct 20, 2020 · 0 comments

Comments

@madscientist
Copy link
Contributor

If you pass a unicode object, rather than a str object, to execute() (etc.) then you'll get a bizarre exception from Cryptography:

  File "nuodb-python/pynuodb/cursor.py", line 120, in execute
    exec_result = self._execute(operation)
  File "nuodb-python/pynuodb/cursor.py", line 153, in _execute
    return self.session.execute_statement(self._statement_cache.get_statement(), operation)
  File "nuodb-python/pynuodb/encodedsession.py", line 309, in execute_statement
    self._exchangeMessages()
  File "nuodb-python/pynuodb/encodedsession.py", line 1073, in _exchangeMessages
    self.send(self.__output)
  File "nuodb-python/pynuodb/session.py", line 351, in send
    message = self.__cipherOut.transform(message)
  File "nuodb-python/pynuodb/crypt.py", line 321, in transform
    transformed = self.cipher.update(data)
  File "/usr/lib/python2.7/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 149, in update
    return self._ctx.update(data)
  File "/usr/lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 124, in update
    n = self.update_into(data, buf)
  File "/usr/lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 140, in update_into
    self._backend._ffi.from_buffer(data), len(data)
TypeError: from_buffer() cannot return the address of a unicode object
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

1 participant