vinta/awesome-python — pull request #280 by myd7349 (2014-12-09 06:30:24+00:00)
Title: Specify encoding explicitly

Since the default system encoding of my Win7 x64(simplified Chinese) OS is not utf-8, but GBK; sort.py doesn't work in Python 3.4.2. The traceback message is:
Traceback (most recent call last):
File "E:\sort.py", line 52, in
main()
File "E:\sort.py", line 22, in main
read_me = read_me_file.readlines()
UnicodeDecodeError: 'gbk' codec can't decode byte 0x93 in position 6947: illegal multibyte sequence
So I just specify the encoding explicitly by passing the keyword argument 'encoding'. (Otherwise, Python 3.x will use the system's default encoding.)

The builtin 'open' function in Python 2.7.8 doesn't provide such a parameter, however. So I use codecs.open instead.