Colin Watson has proposed merging
~cjwatson/launchpad:py3-translationimportqueue-basestring into launchpad:master.
Commit message:
Fix incorrect use of basestring in TranslationImportQueue
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/389438
TranslationImportQueue._getFileObjectAndSize uses file_or_data to construct a
BytesIO if it's a basestring, but that doesn't actually make sense: BytesIO
only accepts bytes and will raise TypeError if given a unicode object. Make
the isinstance test correct.
--
Your team Launchpad code reviewers is requested to review the proposed merge of
~cjwatson/launchpad:py3-translationimportqueue-basestring into launchpad:master.
diff --git a/lib/lp/translations/model/translationimportqueue.py b/lib/lp/translations/model/translationimportqueue.py
index fa41afa..8856aee 100644
--- a/lib/lp/translations/model/translationimportqueue.py
+++ b/lib/lp/translations/model/translationimportqueue.py
@@ -1056,7 +1056,7 @@ class TranslationImportQueue:
def _getFileObjectAndSize(self, file_or_data):
"""Get the size of a seekable file object."""
- if (isinstance(file_or_data, basestring)):
+ if isinstance(file_or_data, bytes):
file_obj = BytesIO(file_or_data)
file_size = len(file_or_data)
else:
_______________________________________________
Mailing list: https://launchpad.net/~launchpad-reviewers
Post to : [email protected]
Unsubscribe : https://launchpad.net/~launchpad-reviewers
More help : https://help.launchpad.net/ListHelp