Skip to content

Commit

Permalink
Fixed package install error with Python 3.6 without system locale.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Mar 10, 2020
1 parent fcb0253 commit 7ccb5a0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions news/642.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed package install error with Python 3.6 without system locale.
See `coredev issue 642 <https://github.com/plone/buildout.coredev/issues/642#issuecomment-597008272>`_.
[maurits]
19 changes: 17 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,26 @@

version = '2.9.6.dev0'


def read(filename):
with open(filename) as myfile:
try:
return myfile.read()
except UnicodeDecodeError:
# Happens on one Jenkins node on Python 3.6,
# so maybe it happens for users too.
pass
# Opening and reading as text failed, so retry opening as bytes.
with open(filename, "rb") as myfile:
contents = myfile.read()
return contents.decode("utf-8")

short_description = """\
Framework for content types as filesystem code and TTW (Zope/CMF/Plone)\
"""
long_description = open("README.rst").read() + "\n"
long_description += open("CHANGES.rst").read()
long_description = read("README.rst")
long_description += "\n"
long_description += read("CHANGES.rst")

setup(
name='plone.dexterity',
Expand Down

0 comments on commit 7ccb5a0

Please sign in to comment.