launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #24217
Re: [Merge] ~pappacena/launchpad:fix-encoding-css-combine into launchpad:master
Diff comments:
> diff --git a/lib/lp/scripts/utilities/js/combinecss.py b/lib/lp/scripts/utilities/js/combinecss.py
> index 1aa1072..1bb94c2 100755
> --- a/lib/lp/scripts/utilities/js/combinecss.py
> +++ b/lib/lp/scripts/utilities/js/combinecss.py
> @@ -75,9 +75,9 @@ def main():
>
> combo = ComboFile(absolute_names, target)
> if combo.needs_update():
> - result = ''
> + result = u''
> for content in combine_files(names, icing):
> - result += content
> + result += content.decode('utf8')
>
> with open(target, 'w') as f:
> - f.write(result)
> + f.write(result.encode('utf8'))
This will break in Python 3, because the file object expects str but you're writing bytes. The point of upgrading cssutils was to be more Python 3-friendly, so this is unfortunate. Can we fix that? Changing the open to open(target, 'wb') should be enough.
--
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/377331
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:fix-encoding-css-combine into launchpad:master.
References