Skip to content

Commit 4c67dfc

Browse files
authored
Merge pull request #132 from buckket/setup_unicode_fix
Make use of io.open() with explicit file encoding in setup.py
2 parents f0ee018 + c82cd5f commit 4c67dfc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
pass
77

88
import distribute_setup
9+
import io
910
import sys
1011
import platform
1112
distribute_setup.use_setuptools()
1213
from setuptools import setup, Extension, find_packages
1314

15+
open_as_utf8 = lambda x: io.open(x, encoding='utf-8')
16+
1417
kernel = platform.release()
1518

1619
if kernel >= '4.1.0':
@@ -35,7 +38,7 @@
3538
author = 'Justin Cooper',
3639
author_email = '[email protected]',
3740
description = 'A module to control BeagleBone IO channels',
38-
long_description = open('README.rst').read() + open('CHANGELOG.rst').read(),
41+
long_description = open_as_utf8('README.rst').read() + open_as_utf8('CHANGELOG.rst').read(),
3942
license = 'MIT',
4043
keywords = 'Adafruit BeagleBone IO GPIO PWM ADC',
4144
url = 'https://github.com/adafruit/adafruit-beaglebone-io-python/',

0 commit comments

Comments
 (0)