ndparker / rjsmin

Fast javascript minifier for Python
http://opensource.perlig.de/rjsmin/
Apache License 2.0
60 stars 15 forks source link

Read UTF-8 data as UTF-8 #2

Closed svenstaro closed 9 years ago

svenstaro commented 9 years ago

You have UTF-8 data that you read during configuration but it might be read as ASCII on systems that use LC_ALL="C". This is the case with configuration scripts such as ansible. My patch is a compatible way of opening UTF-8 as UTF-8 at all times. And yes, this is an actual error for us otherwise.

ndparker commented 9 years ago

Thanks. Apparently Github failed to notify me about this PR :/

For various reasons I reworked your patches. The result is in commit ac31f03644cf4b38c45d1b4c525f984cd279e066. I don't want to use io.open in python2, because the _setup stuff is supposed to work with older versions as well (also, it's subtree'd now).

Can you give the current HEAD a shot? If it works properly, I'll use the same changes for the other projects (like rcssmin), too.

svenstaro commented 9 years ago

Works for me. The latin-1 does confuse me a bit, though.

ndparker commented 9 years ago

Thanks.

Those latin-1 parts modifiy epydoc output. This is just the failsafe way to do it.

svenstaro commented 9 years ago

Looks resolved to me then!

ndparker commented 9 years ago

Great. Thanks again.

svenstaro commented 9 years ago

Can you make a release for this so people on PyPI get it too? Last release is also quite long ago.

ndparker commented 9 years ago

Yes, as soon as I have some free cycles. The last release happened so long ago, because nothing changed so far :-)