launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #26258
[Merge] ~cjwatson/launchpad:py3-doctest-decode-librarian-content into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-doctest-decode-librarian-content into launchpad:master.
Commit message:
Decode librarian content in doctests before printing it
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/397706
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-doctest-decode-librarian-content into launchpad:master.
diff --git a/lib/lp/code/doc/codeimport-result.txt b/lib/lp/code/doc/codeimport-result.txt
index fd0b617..0e0fc26 100644
--- a/lib/lp/code/doc/codeimport-result.txt
+++ b/lib/lp/code/doc/codeimport-result.txt
@@ -71,7 +71,7 @@ read-only records of what happened.
In order to read the actual log file, the transaction needs to be committed
for the Librarian to save the file.
- >>> print(new_result.log_file.read())
+ >>> print(new_result.log_file.read().decode('UTF-8'))
several
lines
of
diff --git a/lib/lp/translations/doc/poexport-queue.txt b/lib/lp/translations/doc/poexport-queue.txt
index 58d9317..2659006 100644
--- a/lib/lp/translations/doc/poexport-queue.txt
+++ b/lib/lp/translations/doc/poexport-queue.txt
@@ -345,7 +345,7 @@ Exporting this pofile yields both messages in the resulting file.
>>> process_queue(transaction, logging.getLogger())
INFO:root:Stored file at http://...eo.po
- >>> print(get_newest_librarian_file().read())
+ >>> print(get_newest_librarian_file().read().decode('UTF-8'))
# Esperanto translation for ...
...
"X-Generator: Launchpad (build ...)\n"
@@ -366,7 +366,7 @@ in Ubuntu compared to upstream.
>>> process_queue(transaction, logging.getLogger())
INFO:root:Stored file at http://...eo.po
- >>> print(get_newest_librarian_file().read())
+ >>> print(get_newest_librarian_file().read().decode('UTF-8'))
# IMPORTANT: This file does NOT contain a complete PO file structure.
# DO NOT attempt to import this file back into Launchpad.
...
diff --git a/lib/lp/translations/doc/translationimportqueue.txt b/lib/lp/translations/doc/translationimportqueue.txt
index e565e62..2e853ea 100644
--- a/lib/lp/translations/doc/translationimportqueue.txt
+++ b/lib/lp/translations/doc/translationimportqueue.txt
@@ -1058,7 +1058,7 @@ It is possible to update the content of an entry in the queue.
>>> existing_entry = getFirstEvoEntryByPath(queue, 'foo.pot')
>>> existing_entry = removeSecurityProxy(existing_entry)
- >>> print(existing_entry.content.read())
+ >>> print(existing_entry.content.read().decode('UTF-8'))
Foo template
>>> entry = translationimportqueue.addOrUpdateEntry(
@@ -1069,7 +1069,7 @@ It is possible to update the content of an entry in the queue.
>>> transaction.commit()
>>> entry is existing_entry
True
- >>> print(entry.content.read())
+ >>> print(entry.content.read().decode('UTF-8'))
New content
Not specifying the potemplate in this situation still selects the same entry
@@ -1082,14 +1082,14 @@ on a best match basis. The entry is updated.
>>> transaction.commit()
>>> entry is existing_entry
True
- >>> print(entry.content.read())
+ >>> print(entry.content.read().decode('UTF-8'))
Even newer content
Same goes for pofile entries.
>>> existing_entry = getFirstEvoEntryByPath(queue, 'es.po')
>>> existing_entry = removeSecurityProxy(existing_entry)
- >>> print(existing_entry.content.read())
+ >>> print(existing_entry.content.read().decode('UTF-8'))
Spanish translation
>>> entry = removeSecurityProxy(translationimportqueue.addOrUpdateEntry(
@@ -1098,7 +1098,7 @@ Same goes for pofile entries.
>>> transaction.commit()
>>> entry is existing_entry
True
- >>> print(entry.content.read())
+ >>> print(entry.content.read().decode('UTF-8'))
New po content
Now, attaching the same layout to a different template for the same product,
@@ -1164,7 +1164,7 @@ When uploading to the prouct now, the best matching entry is updated.
>>> transaction.commit()
>>> entry is existing_entry
True
- >>> print(entry.content.read())
+ >>> print(entry.content.read().decode('UTF-8'))
New bar content
Filename filters