The Issue

After a fresh install of Enthought Canopy 1.3.0.1715 win x86 version, it starts with a welcome error.

The Solution

A possible solution is mentioned on the enthought blog in a reply of this post.

The solution is to change the code in file

C:\Program Files\Enthought\Canopy32\App\appdata\canopy-1.3.0.1715.win-x86\Lib\mimetypes.py


from

254    i += 1
255
256    default_encoding = sys.getdefaultencoding()


to

254    i += 1
255
256    if sys.getdefaultencoding()!='gbk':
257        reload(sys)
258        sys.setdefaultencoding('gbk')
259
260    default_encoding = sys.getdefaultencoding()


It Works

I am still inexperienced to know why this solution works.

However, from the code, it can be found that the windows xp doesn’t provide a proper return string ‘gbk’. In the solution, the system default encoding is set manually to ‘gbk’.

The problem could be the system - windows xp, but also could be the python function, which provides the system settings.