Use io.open() instead of builtin open()

Windows does not like when we open README.rst using builtin open():

  Traceback (most recent call last):
    File "setup.py", line 360, in <module>
      long_description=open('README.rst', 'rU').read(),
    File "c:\hostedtoolcache\windows\python\3.6.8\x64\lib\encodings\cp1252.py", line 23, in decode
      return codecs.charmap_decode(input,self.errors,decoding_table)[0]
  UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 1720: character maps to <undefined>
This commit is contained in:
Sajith Sasidharan 2021-04-05 19:11:58 -04:00
parent d9446f9f06
commit ae6e1e9e2f

View File

@ -11,6 +11,7 @@ import sys
# See the docs/about.rst file for licensing information. # See the docs/about.rst file for licensing information.
import os, subprocess, re import os, subprocess, re
from io import open
basedir = os.path.dirname(os.path.abspath(__file__)) basedir = os.path.dirname(os.path.abspath(__file__))
@ -357,7 +358,7 @@ if version:
setup(name="tahoe-lafs", # also set in __init__.py setup(name="tahoe-lafs", # also set in __init__.py
description='secure, decentralized, fault-tolerant file store', description='secure, decentralized, fault-tolerant file store',
long_description=open('README.rst', 'r').read(), long_description=open('README.rst', 'r', encoding='utf-8').read(),
author='the Tahoe-LAFS project', author='the Tahoe-LAFS project',
author_email='tahoe-dev@tahoe-lafs.org', author_email='tahoe-dev@tahoe-lafs.org',
url='https://tahoe-lafs.org/', url='https://tahoe-lafs.org/',