Skip to content

Commit

Permalink
Fix bin/mkwsgiinstance on Python 3
Browse files Browse the repository at this point in the history
When Zope was installed via `pip` an error occurs later on because the path
returned by `get_zope2path` is bytes but text is expected.

In Python 3.7+ there is an alias for `universal_newlines=True` which is
`text=True`. See https://docs.python.org/3.8/library/subprocess.html#subprocess.check_output
  • Loading branch information
Michael Howitz committed Oct 11, 2018
1 parent fae058e commit f3c0689
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGES.rst
Expand Up @@ -11,7 +11,10 @@ https://github.com/zopefoundation/Zope/blob/4.0a6/CHANGES.rst
4.0b7 (unreleased)
------------------

- Nothing changed yet.
Bugfixes
++++++++

- Fix `bin/mkwsgiinstance` on Python 3 when Zope was installed via ``pip``.


4.0b6 (2018-10-11)
Expand Down
1 change: 1 addition & 0 deletions src/Zope2/utilities/mkwsgiinstance.py
Expand Up @@ -217,6 +217,7 @@ def get_zope2path(python):
try:
output = subprocess.check_output(
[python, '-c', 'import Zope2; print(Zope2.__file__)'],
universal_newlines=True, # makes Python 3 return text, not bytes
stderr=subprocess.PIPE)
zope2file = output.strip()
except subprocess.CalledProcessError:
Expand Down

0 comments on commit f3c0689

Please sign in to comment.