clowwindy/shadowsocks — pull request #203 by felixonmars (2014-11-01 14:54:19+00:00)
Title: setup.py: use codecs.open() so it works for non-utf8 locales

When building in a non-utf8 locale, the current `open()` approach in `setup.py` will fail in python 3.x. This PR uses `codecs.open` which works correctly over all versions of python 2.x or 3.x.

Error examples without the patch:
```
$ LANG=C python setup.py build
Traceback (most recent call last):
File "setup.py", line 5, in
long_description = f.read()
File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 115: ordinal not in range(128)
```

```
$ LANG=zh_CN.GBK python setup.py build
Traceback (most recent call last):
File "setup.py", line 5, in
long_description = f.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 117: illegal multibyte sequence
```