freebsd-ports/devel/py-azure-mgmt-core/files/patch-setup.py
Dima Panov 20d8bd6536 devel/py-azure-mgmt-core: Fix build with Python 3.6
* Enable default UTF-8 encoding for file operations
in setup.py which fixes the build issue with Python 3.6.

Approved by:	portmgr blanket (fix build)
2021-01-11 06:53:17 +00:00

11 lines
529 B
Python

--- setup.py.orig 2020-10-05 05:36:52 UTC
+++ setup.py
@@ -21,7 +21,7 @@ package_folder_path = PACKAGE_NAME.replace('-', '/')
namespace_name = PACKAGE_NAME.replace('-', '.')
# Version extraction inspired from 'requests'
-with open(os.path.join(package_folder_path, '_version.py'), 'r') as fd:
+with open(os.path.join(package_folder_path, '_version.py'), 'r', encoding='utf-8') as fd:
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', # type: ignore
fd.read(), re.MULTILINE).group(1)