Handle encoding when opening file for both py2/py3

This commit is contained in:
Ch3LL 2019-01-09 12:21:36 -05:00
parent e6c9253ff4
commit 77101ed4fc
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73
2 changed files with 5 additions and 2 deletions

View file

@ -2,7 +2,7 @@
What is SaltStack? What is SaltStack?
================== ==================
SaltStack makes software for complex systems management at scale. SaltStack makes software for complex systems management at scale.
SaltStack is the company that created and maintains the Salt Open SaltStack is the company that created and maintains the Salt Open
project and develops and sells SaltStack Enterprise software, services project and develops and sells SaltStack Enterprise software, services
and support. Easy enough to get running in minutes, scalable enough to and support. Easy enough to get running in minutes, scalable enough to

View file

@ -855,7 +855,10 @@ class SaltDistribution(distutils.dist.Distribution):
self.name = 'salt-ssh' if PACKAGED_FOR_SALT_SSH else 'salt' self.name = 'salt-ssh' if PACKAGED_FOR_SALT_SSH else 'salt'
self.salt_version = __version__ # pylint: disable=undefined-variable self.salt_version = __version__ # pylint: disable=undefined-variable
self.description = 'Portable, distributed, remote execution and configuration management system' self.description = 'Portable, distributed, remote execution and configuration management system'
with open(SALT_LONG_DESCRIPTION_FILE, encoding='utf-8') as f: kwargs = {}
if IS_PY3:
kwargs['encoding'] = 'utf-8'
with open(SALT_LONG_DESCRIPTION_FILE, **kwargs) as f:
self.long_description = f.read() self.long_description = f.read()
self.long_description_content_type = 'text/x-rst' self.long_description_content_type = 'text/x-rst'
self.author = 'Thomas S Hatch' self.author = 'Thomas S Hatch'