Issue 229: Add explicit encoding, license and unix line separators.

Some maintainers for different linux distribution are having some
problems with the encoding on different python versions. This change
intents to make all python files define explicitly the encoding, license
and unix line separators. Remove one example of the README.rst file
where a possible non UTF-8 character is used.
This commit is contained in:
Ernesto Rodriguez Ortiz
2018-12-05 09:43:45 -05:00
parent 7f125590f7
commit 53b4518afb
72 changed files with 1810 additions and 1589 deletions

View File

@@ -1,4 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2003, Taro Ogawa. All Rights Reserved.
# Copyright (c) 2013, Savoir-faire Linux inc. All Rights Reserved.
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA
import re
from io import open
from setuptools import find_packages, setup
@@ -17,8 +35,8 @@ CLASSIFIERS = [
'Topic :: Text Processing :: Linguistic',
]
LONG_DESC = open('README.rst', 'rt').read() + '\n\n' + \
open('CHANGES.rst', 'rt').read()
LONG_DESC = open('README.rst', 'rt', encoding="utf-8").read() + '\n\n' + \
open('CHANGES.rst', 'rt', encoding="utf-8").read()
def find_version(fname):
@@ -26,7 +44,7 @@ def find_version(fname):
Returns str or raises RuntimeError
"""
version = ''
with open(fname, 'r') as fp:
with open(fname, 'r', encoding="utf-8") as fp:
reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
for line in fp:
m = reg.match(line)