aboutsummaryrefslogtreecommitdiff
path: root/python/olm/pk.py
diff options
context:
space:
mode:
authorDamir Jelić <poljar@termina.org.uk>2019-06-19 14:45:20 +0200
committerDamir Jelić <poljar@termina.org.uk>2019-06-19 15:03:57 +0200
commit5e24c605d2926e23273089058741fe69e1b3030a (patch)
tree53b866dc74614c447bd52fcf9b0169c87b7488d9 /python/olm/pk.py
parentba65551d5f9985d947e768787ae05664514ce1e2 (diff)
_compat: Change the to_native_str into a to_unicode_str function.
The to_native_str function was supposed to produce Unicode decoded native strings for python2 and python3. Upon further consideration this doesn't make much sense since under python2 it would need to decode the bytes into a Unicode string and turn it back into a python2 str. The ability to use the replacement character requires us to use a Unicode string under python2 as well.
Diffstat (limited to 'python/olm/pk.py')
-rw-r--r--python/olm/pk.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/olm/pk.py b/python/olm/pk.py
index 158c78d..18608b7 100644
--- a/python/olm/pk.py
+++ b/python/olm/pk.py
@@ -40,7 +40,7 @@ from future.utils import bytes_to_native_str
from _libolm import ffi, lib # type: ignore
-from ._compat import URANDOM, to_bytearray, to_native_str
+from ._compat import URANDOM, to_bytearray, to_unicode_str
from ._finalize import track_for_finalization
@@ -361,7 +361,7 @@ class PkDecryption(object):
# clear out copies of the plaintext
lib.memset(plaintext_buffer, 0, max_plaintext_length)
- return to_native_str(plaintext, errors=errors)
+ return to_unicode_str(plaintext, errors=errors)
def _clear_pk_signing(pk_struct):