Merge ~cjwatson/launchpad:py3-diskpool-path-text into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 05742e50441527b8fd80e9bb1f3d5d3f27fc02ba
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-diskpool-path-text
Merge into: launchpad:master
Diff against target: 53 lines (+9/-11)
3 files modified
lib/lp/archivepublisher/tests/deathrow.txt (+3/-3)
lib/lp/archivepublisher/tests/test_deathrow.py (+3/-3)
lib/lp/soyuz/model/publishing.py (+3/-5)
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Review via email: mp+397934@code.launchpad.net

Commit message

Pass text to DiskPoolEntry.pathFor

Description of the change

Python 3 doesn't like us passing bytes here, and there seems to be no need for it on Python 2.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/archivepublisher/tests/deathrow.txt b/lib/lp/archivepublisher/tests/deathrow.txt
2index 3ca510a..92b4381 100644
3--- a/lib/lp/archivepublisher/tests/deathrow.txt
4+++ b/lib/lp/archivepublisher/tests/deathrow.txt
5@@ -202,9 +202,9 @@ Publish files on disk and build a list of all created file paths
6 ... for pub_file in pub.files:
7 ... for pub_file in pub.files:
8 ... file_path = quiet_disk_pool.pathFor(
9- ... pub.component.name.encode('utf-8'),
10- ... pub.source_package_name.encode('utf8'),
11- ... pub_file.libraryfile.filename.encode('utf-8')
12+ ... pub.component.name,
13+ ... pub.source_package_name,
14+ ... pub_file.libraryfile.filename
15 ... )
16 ... unique_file_paths.add(file_path)
17 ... pub.publish(quiet_disk_pool, BufferLogger())
18diff --git a/lib/lp/archivepublisher/tests/test_deathrow.py b/lib/lp/archivepublisher/tests/test_deathrow.py
19index a875633..2d9ca02 100644
20--- a/lib/lp/archivepublisher/tests/test_deathrow.py
21+++ b/lib/lp/archivepublisher/tests/test_deathrow.py
22@@ -56,9 +56,9 @@ class TestDeathRow(TestCase):
23 def getDiskPoolPath(self, pub, pub_file, diskpool):
24 """Return the absolute path to a published file in the disk pool/."""
25 return diskpool.pathFor(
26- pub.component.name.encode('utf-8'),
27- pub.source_package_name.encode('utf8'),
28- pub_file.libraryfile.filename.encode('utf-8'))
29+ pub.component.name,
30+ pub.source_package_name,
31+ pub_file.libraryfile.filename)
32
33 def assertIsFile(self, path):
34 """Assert the path exists and is a regular file."""
35diff --git a/lib/lp/soyuz/model/publishing.py b/lib/lp/soyuz/model/publishing.py
36index 86db3c1..2c84740 100644
37--- a/lib/lp/soyuz/model/publishing.py
38+++ b/lib/lp/soyuz/model/publishing.py
39@@ -172,11 +172,9 @@ class ArchivePublisherBase:
40 """See `IPublishing`"""
41 try:
42 for pub_file in self.files:
43- # XXX cprov 2006-06-12 bug=49510: The encode should not
44- # be needed when retrieving data from DB.
45- source = self.source_package_name.encode('utf-8')
46- component = self.component.name.encode('utf-8')
47- filename = pub_file.libraryfile.filename.encode('utf-8')
48+ source = self.source_package_name
49+ component = self.component.name
50+ filename = pub_file.libraryfile.filename
51 filealias = pub_file.libraryfile
52 sha1 = filealias.content.sha1
53 path = diskpool.pathFor(component, source, filename)

Subscribers

People subscribed via source and target branches

to status/vote changes: