olm: Rename the errors function argument in the decryption functions.

python/unicode_decode_errors
Damir Jelić 2019-06-20 12:16:37 +02:00
parent fec41f9540
commit 7538a1eccf
3 changed files with 6 additions and 6 deletions

View File

@ -176,7 +176,7 @@ class InboundGroupSession(object):
raise OlmGroupSessionError(last_error)
def decrypt(self, ciphertext, errors="replace"):
def decrypt(self, ciphertext, unicode_errors="replace"):
# type: (AnyStr, str) -> Tuple[str, int]
"""Decrypt a message
@ -232,7 +232,7 @@ class InboundGroupSession(object):
plaintext = to_unicode_str(
ffi.unpack(plaintext_buffer, plaintext_length),
errors=errors
errors=unicode_errors
)
# clear out copies of the plaintext

View File

@ -313,7 +313,7 @@ class PkDecryption(object):
return obj
def decrypt(self, message, errors="replace"):
def decrypt(self, message, unicode_errors="replace"):
# type (PkMessage, str) -> str
"""Decrypt a previously encrypted Pk message.
@ -361,7 +361,7 @@ class PkDecryption(object):
# clear out copies of the plaintext
lib.memset(plaintext_buffer, 0, max_plaintext_length)
return to_unicode_str(plaintext, errors=errors)
return to_unicode_str(plaintext, errors=unicode_errors)
def _clear_pk_signing(pk_struct):

View File

@ -273,7 +273,7 @@ class Session(object):
else: # pragma: no cover
raise ValueError("Unknown message type")
def decrypt(self, message, errors="replace"):
def decrypt(self, message, unicode_errors="replace"):
# type: (_OlmMessage, str) -> str
"""Decrypts a message using the session. Returns the plaintext string
on success. Raises OlmSessionError on failure. If the base64 couldn't
@ -320,7 +320,7 @@ class Session(object):
self._check_error(plaintext_length)
plaintext = to_unicode_str(
ffi.unpack(plaintext_buffer, plaintext_length),
errors=errors
errors=unicode_errors
)
# clear out copies of the plaintext