Skip to content

Commit

Permalink
Overcome mbcs codec bug in distutils
Browse files Browse the repository at this point in the history
  • Loading branch information
German Gomez-Herrero committed Aug 29, 2014
1 parent ac696ee commit 08ad0d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
__pycache__
.ropeproject
*.pyc
progressbar33.egg-info
progressbar33.egg-info
build/
dist/
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
import os
from setuptools import setup, find_packages
import progressbar
import codecs

# From: https://mail.python.org/pipermail/python-list/2012-February/620318.html
try:
codecs.lookup('mbcs')
except LookupError:
ascii = codecs.lookup('ascii')
func = lambda name, enc=ascii: {True: enc}.get(name=='mbcs')
codecs.register(func)

# TODO: I don't believe this should be in here. This should be done on package
# creation only
Expand Down

0 comments on commit 08ad0d3

Please sign in to comment.