launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #24527
[Merge] ~cjwatson/launchpad:py3-css-bytes-text into launchpad:master
Colin Watson has proposed merging ~cjwatson/launchpad:py3-css-bytes-text into launchpad:master.
Commit message:
Fix up a few bytes/text mistakes in CSS generation
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/381335
We dealt with most of this in some previous porting work, but missed a few spots.
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-css-bytes-text into launchpad:master.
diff --git a/lib/lp/scripts/utilities/js/jsbuild.py b/lib/lp/scripts/utilities/js/jsbuild.py
index 14841c0..7af59d3 100644
--- a/lib/lp/scripts/utilities/js/jsbuild.py
+++ b/lib/lp/scripts/utilities/js/jsbuild.py
@@ -157,7 +157,8 @@ class CSSComboFile(ComboFile):
if relative_src_dir == ".":
relative_parts = []
else:
- relative_parts = relative_src_dir.split(os.path.sep)
+ relative_parts = relative_src_dir.encode("UTF-8").split(
+ os.path.sep.encode("UTF-8"))
def fix_relative_url(match):
url = match.group(1)
@@ -166,7 +167,7 @@ class CSSComboFile(ComboFile):
url.startswith(b"/") or
url.startswith(b"data:")):
return match.group(0)
- parts = relative_parts + url.split("/")
+ parts = relative_parts + url.split(b"/")
result = []
for part in parts:
if part == b".." and result and result[-1] != b"..":
diff --git a/lib/lp/services/spriteutils.py b/lib/lp/services/spriteutils.py
index 49b8f3d..dd1d2de 100644
--- a/lib/lp/services/spriteutils.py
+++ b/lib/lp/services/spriteutils.py
@@ -245,6 +245,6 @@ class SpriteUtil:
position = self.positions[sprite['filename']]
rule.style.backgroundPosition = '%dpx %dpx' % tuple(position)
- with open(css_file, 'w') as fp:
- fp.write(self.EDIT_WARNING)
+ with open(css_file, 'wb') as fp:
+ fp.write(self.EDIT_WARNING.encode('UTF-8'))
fp.write(self.css_object.cssText)