Skip to content

Commit

Permalink
Fix #3: non-ASCII chars in README.rst causing encoding issues in setu…
Browse files Browse the repository at this point in the history
…p.py
  • Loading branch information
benhoyt committed Aug 22, 2017
1 parent 8d76697 commit 8e5b444
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion graphyte.py
Expand Up @@ -20,7 +20,7 @@

__all__ = ['Sender', 'init', 'send']

__version__ = '1.2'
__version__ = '1.3'

default_sender = None
logger = logging.getLogger(__name__)
Expand Down
12 changes: 10 additions & 2 deletions setup.py
Expand Up @@ -2,11 +2,19 @@

import os
import re
import sys
from distutils.core import setup


# Read files as byte strings on Python 2.x, unicode strings on 3.x
if sys.version_info < (3, 0):
open_args = {}
else:
open_args = {'encoding': 'utf-8'}


# Because it's best not to import the module in setup.py
with open(os.path.join(os.path.dirname(__file__), 'graphyte.py')) as f:
with open(os.path.join(os.path.dirname(__file__), 'graphyte.py'), **open_args) as f:
for line in f:
match = re.match(r"__version__.*'([0-9.]+)'", line)
if match:
Expand All @@ -17,7 +25,7 @@


# Read long_description from README.rst
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as f:
with open(os.path.join(os.path.dirname(__file__), 'README.rst'), **open_args) as f:
long_description = f.read()


Expand Down

0 comments on commit 8e5b444

Please sign in to comment.