Bug 1142525

Summary: Build fails with UnicodeDecodeError for files containing Unicode chars
Product: [Fedora] Fedora Reporter: Dan Callaghan <dcallagh>
Component: python-webassetsAssignee: Praveen Kumar <kumarpraveen.nitdgp>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: dcallagh, kumarpraveen.nitdgp, pj.pandit
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-webassets-0.9-4.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-20 23:01:36 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dan Callaghan 2014-09-17 00:35:07 UTC
Description of problem:
webassets chokes on input files with non-ASCII bytes.

Version-Release number of selected component (if applicable):
python-webassets-0.9-1.fc20.noarch

How reproducible:
not easily, but reliably

Steps to Reproduce:
1. Set up a project using webassets uglifyjs filter
2. Use a JS source file with non-ASCII chars

Actual results:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1470, in full_dispatch_request
    self.try_trigger_before_first_request_functions()
  File "/usr/lib/python2.7/site-packages/flask/app.py", line 1497, in try_trigger_before_first_request_functions
    func()
  File "/home/dcallagh/work/beaker/Server/bkr/server/wsgi.py", line 89, in init
    assets.build_assets()
  File "/home/dcallagh/work/beaker/Server/bkr/server/assets.py", line 114, in build_assets
    bundle.build()
  File "/usr/lib/python2.7/site-packages/webassets/bundle.py", line 567, in build
    disable_cache=disable_cache))
  File "/usr/lib/python2.7/site-packages/webassets/bundle.py", line 504, in _build
    force, disable_cache=disable_cache, extra_filters=extra_filters)
  File "/usr/lib/python2.7/site-packages/webassets/bundle.py", line 459, in _merge_and_apply
    return filtertool.apply(final, selected_filters, 'output')
  File "/usr/lib/python2.7/site-packages/webassets/merge.py", line 272, in apply
    return self._wrap_cache(key, func)
  File "/usr/lib/python2.7/site-packages/webassets/merge.py", line 219, in _wrap_cache
    content = func().getvalue()
  File "/usr/lib/python2.7/site-packages/webassets/merge.py", line 252, in func
    getattr(filter, type)(data, out, **kwargs_final)
  File "/usr/lib/python2.7/site-packages/webassets/filter/uglifyjs.py", line 32, in output
    self.subprocess(args, out, _in)
  File "/usr/lib/python2.7/site-packages/webassets/filter/__init__.py", line 483, in subprocess
    f.write(data.read() if hasattr(data, 'read') else data)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u017a' in position 133416: ordinal not in range(128)

Expected results:
No exception

Additional info:
Upstream issue:
https://github.com/miracle2k/webassets/issues/255
Upstream PR:
https://github.com/miracle2k/webassets/pull/260
Patch applies cleanly to 0.9:
https://github.com/graffic/webassets/commit/10d30de8738fff400d083f014f3f2c849cb0e430.patch

Comment 1 Fedora Update System 2014-11-10 11:51:09 UTC
python-webassets-0.9-4.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/python-webassets-0.9-4.el7

Comment 2 Fedora Update System 2014-11-10 11:52:52 UTC
python-webassets-0.9-4.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/python-webassets-0.9-4.fc20

Comment 3 Fedora Update System 2014-11-10 11:54:00 UTC
python-webassets-0.9-4.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/python-webassets-0.9-4.fc19

Comment 4 Fedora Update System 2014-11-12 02:43:22 UTC
Package python-webassets-0.9-4.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-webassets-0.9-4.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-14770/python-webassets-0.9-4.fc20
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2014-11-20 23:01:36 UTC
python-webassets-0.9-4.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2014-11-20 23:02:54 UTC
python-webassets-0.9-4.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2014-11-25 20:08:49 UTC
python-webassets-0.9-4.el7 has been pushed to the Fedora EPEL 7 stable repository.  If problems still persist, please make note of it in this bug report.