launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #26287
[Merge] ~cjwatson/launchpad:py3-diskpool-path-text into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-diskpool-path-text into launchpad:master.
Commit message:
Pass text to DiskPoolEntry.pathFor
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/397934
Python 3 doesn't like us passing bytes here, and there seems to be no need for it on Python 2.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-diskpool-path-text into launchpad:master.
diff --git a/lib/lp/archivepublisher/tests/deathrow.txt b/lib/lp/archivepublisher/tests/deathrow.txt
index 3ca510a..92b4381 100644
--- a/lib/lp/archivepublisher/tests/deathrow.txt
+++ b/lib/lp/archivepublisher/tests/deathrow.txt
@@ -202,9 +202,9 @@ Publish files on disk and build a list of all created file paths
... for pub_file in pub.files:
... for pub_file in pub.files:
... file_path = quiet_disk_pool.pathFor(
- ... pub.component.name.encode('utf-8'),
- ... pub.source_package_name.encode('utf8'),
- ... pub_file.libraryfile.filename.encode('utf-8')
+ ... pub.component.name,
+ ... pub.source_package_name,
+ ... pub_file.libraryfile.filename
... )
... unique_file_paths.add(file_path)
... pub.publish(quiet_disk_pool, BufferLogger())
diff --git a/lib/lp/archivepublisher/tests/test_deathrow.py b/lib/lp/archivepublisher/tests/test_deathrow.py
index a875633..2d9ca02 100644
--- a/lib/lp/archivepublisher/tests/test_deathrow.py
+++ b/lib/lp/archivepublisher/tests/test_deathrow.py
@@ -56,9 +56,9 @@ class TestDeathRow(TestCase):
def getDiskPoolPath(self, pub, pub_file, diskpool):
"""Return the absolute path to a published file in the disk pool/."""
return diskpool.pathFor(
- pub.component.name.encode('utf-8'),
- pub.source_package_name.encode('utf8'),
- pub_file.libraryfile.filename.encode('utf-8'))
+ pub.component.name,
+ pub.source_package_name,
+ pub_file.libraryfile.filename)
def assertIsFile(self, path):
"""Assert the path exists and is a regular file."""
diff --git a/lib/lp/soyuz/model/publishing.py b/lib/lp/soyuz/model/publishing.py
index 86db3c1..2c84740 100644
--- a/lib/lp/soyuz/model/publishing.py
+++ b/lib/lp/soyuz/model/publishing.py
@@ -172,11 +172,9 @@ class ArchivePublisherBase:
"""See `IPublishing`"""
try:
for pub_file in self.files:
- # XXX cprov 2006-06-12 bug=49510: The encode should not
- # be needed when retrieving data from DB.
- source = self.source_package_name.encode('utf-8')
- component = self.component.name.encode('utf-8')
- filename = pub_file.libraryfile.filename.encode('utf-8')
+ source = self.source_package_name
+ component = self.component.name
+ filename = pub_file.libraryfile.filename
filealias = pub_file.libraryfile
sha1 = filealias.content.sha1
path = diskpool.pathFor(component, source, filename)