Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeEncodeError: 'ascii' codec can't encode character exception in BaseHunk class #56

Closed
farvour opened this issue Aug 26, 2014 · 1 comment

Comments

@farvour
Copy link

farvour commented Aug 26, 2014

Tue Aug 26 11:06:22 2014] [error] [client 192.168.21.146] File "/opt/lang/python/virtualenvs/3.4/bi/lib/python3.4/site-packages/webassets/merge.py", line 60, in save [Tue Aug 26 11:06:22 2014] [error] [client 192.168.21.146] f.write(self.data()) [Tue Aug 26 11:06:22 2014] [error] [client 192.168.21.146] UnicodeEncodeError: 'ascii' codec can't encode character '\\xa0' in position 158569: ordinal not in range(128)

The fopen method fails to set the encoding when writing bytes back out to the cached file.

def save(self, filename):
    with open(filename, 'w') as f:
        f.write(self.data())

I will be submitting a pull request for this.

@farvour
Copy link
Author

farvour commented Aug 26, 2014

Meant to put this to the webassets project, my bad.

@farvour farvour closed this as completed Aug 26, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant