[openstack-dev] [Horizon] Problem with compressing scss files

Thomas Goirand zigo at debian.org
Sun Sep 28 07:35:39 UTC 2014


After a long investigation, I have found out that, in python-pyscss,
there's the following code in scss/expression.py:

    return String(
        six.u("%s(%s)" % (func_name, six.u(", ".join(rendered_args)))),
        quotes=None)

If I remove the first six.u(), and the code becomes like this:

    return String(
        "%s(%s)" % (func_name, six.u(", ".join(rendered_args))),
        quotes=None)

then everything works. Though this comes from a Debian specific patch
for which I added the six.u() calls, to make it work in Python 3.2 in
Wheezy. The original code is in fact:

    return String(
        u"%s(%s)" % (func_name, u", ".join(rendered_args)),
        quotes=None)

So, could anyone help me fixing this? What's the way to make it always
work? I wouldn't like to just drop Python 3.x support because of this... :(

Cheers,

Thomas Goirand (zigo)

On 09/28/2014 12:38 AM, Thomas Goirand wrote:
> Hi,
> 
> When installing the Juno b3 version of Horizon, the package that I
> maintain does the compressions, so that we can use the offline
> compression mode, which offers better performances. Unfortunately, it
> just breaks. See the log below.
> 
> Does anyone has an idea of what's going on, and why this happens?
> 
> Cheers,
> 
> Thomas Goirand (zigo)
> 
> Setting up openstack-dashboard (2014.2~b3-1) ...
> RemovedInDjango18Warning: 'The `cycle` template tag is changing to
> escape its arguments; the non-autoescaping version is deprecated. Load
> it from the `future` tag library to start using the new behavior.
> WARNING:py.warnings:RemovedInDjango18Warning: 'The `cycle` template tag
> is changing to escape its arguments; the non-autoescaping version is
> deprecated. Load it from the `future` tag library to start using the new
> behavior.
> Found 'compress' tags in:
> 	/usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html
> 	/usr/lib/python2.7/dist-packages/horizon/templates/horizon/_conf.html
> 	/usr/lib/python2.7/dist-packages/horizon/templates/horizon/_scripts.html
> Compressing... CommandError: An error occured during rendering
> /usr/share/openstack-dashboard/openstack_dashboard/templates/_stylesheets.html:
> Error evaluating expression:
>     (twbs-font-path("") != unquote('twbs-font-path("")'))
> 
>>From bootstrap/scss/bootstrap/_variables.scss:1
> ...imported from bootstrap/scss/bootstrap.scss:6
> ...imported from <string u'// bootstrap overrides:\n$icon-font-path:
> "../../bo'...>:0
> Traceback:
>   File "/usr/lib/python2.7/dist-packages/scss/expression.py", line 130,
> in evaluate_expression
>     return ast.evaluate(self, divide=divide)
>   File "/usr/lib/python2.7/dist-packages/scss/expression.py", line 182,
> in evaluate
>     return self.contents.evaluate(calculator, divide=True)
>   File "/usr/lib/python2.7/dist-packages/scss/expression.py", line 207,
> in evaluate
>     left = self.left.evaluate(calculator, divide=True)
>   File "/usr/lib/python2.7/dist-packages/scss/expression.py", line 329,
> in evaluate
>     six.u("%s(%s)" % (func_name, six.u(", ".join(rendered_args)))),
>   File "/usr/lib/python2.7/dist-packages/six.py", line 601, in u
>     return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape")
> TypeError: decoding Unicode is not supported
> dpkg: error processing package openstack-dashboard (--configure):
>  subprocess installed post-installation script returned error exit status 1
> Errors were encountered while processing:
>  openstack-dashboard
> E: Sub-process /usr/bin/dpkg returned an error code (1)
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 




More information about the OpenStack-dev mailing list