Merge lp:~adam-collard/lazr.restfulclient/python3-httplib2-fix into lp:lazr.restfulclient

Proposed by Adam Collard
Status: Merged
Merged at revision: 162
Proposed branch: lp:~adam-collard/lazr.restfulclient/python3-httplib2-fix
Merge into: lp:lazr.restfulclient
Diff against target: 37 lines (+5/-4)
2 files modified
src/lazr/restfulclient/_browser.py (+2/-2)
src/lazr/restfulclient/tests/test_atomicfilecache.py (+3/-2)
To merge this branch: bzr merge lp:~adam-collard/lazr.restfulclient/python3-httplib2-fix
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+358926@code.launchpad.net

Commit message

When matching with httplib2's re_url_scheme, use unicode not bytes.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

This fixes tox and is OK to merge, but it doesn't actually fix the Python 3 breakage. I'll work on that.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/lazr/restfulclient/_browser.py'
--- src/lazr/restfulclient/_browser.py 2018-11-16 01:58:11 +0000
+++ src/lazr/restfulclient/_browser.py 2018-11-16 18:38:10 +0000
@@ -95,8 +95,8 @@
95 """95 """
9696
97 try:97 try:
98 if isinstance(filename, unicode_type):98 if isinstance(filename, bytes):
99 filename_match = filename.encode('utf-8')99 filename_match = filename.decode('utf-8')
100 else:100 else:
101 filename_match = filename101 filename_match = filename
102102
103103
=== modified file 'src/lazr/restfulclient/tests/test_atomicfilecache.py'
--- src/lazr/restfulclient/tests/test_atomicfilecache.py 2014-07-28 15:35:35 +0000
+++ src/lazr/restfulclient/tests/test_atomicfilecache.py 2018-11-16 18:38:10 +0000
@@ -32,7 +32,8 @@
3232
33import httplib233import httplib2
3434
35from lazr.restfulclient._browser import AtomicFileCache35from lazr.restfulclient._browser import (
36 AtomicFileCache, safename)
3637
3738
38class TestFileCacheInterface(unittest.TestCase):39class TestFileCacheInterface(unittest.TestCase):
@@ -53,7 +54,7 @@
5354
54 def make_file_cache(self):55 def make_file_cache(self):
55 """Make a FileCache-like object to be tested."""56 """Make a FileCache-like object to be tested."""
56 return self.file_cache_factory(self.cache_dir)57 return self.file_cache_factory(self.cache_dir, safename)
5758
58 def test_get_non_existent_key(self):59 def test_get_non_existent_key(self):
59 # get() returns None if the key does not exist.60 # get() returns None if the key does not exist.

Subscribers

People subscribed via source and target branches