From d3832a20edbd43d785c4bbe06e265a3a00e17026 Mon Sep 17 00:00:00 2001 From: Thomas Sibley Date: Tue, 13 Sep 2022 11:28:08 -0700 Subject: [PATCH] Use Python 3.8 for standalone installations instead of 3.10 This sidesteps issues with the relatively-new files() / Traversable API of importlib.resources that is present in 3.9 and 3.10 but not supported by PyOxidizer's OxidizedImporter. It only supports the original importlib.resources API and importlib.resources doesn't implement a backwards compatibility layer/adapter until Python 3.11 (not yet released). By using 3.8, code which tests for the presence of the new API in importlib.resources or tests the Python version will not detect stdlib support for the new API and thus will generally fall back to the API supported by PyOxidizer. Related-to: --- pyoxidizer.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyoxidizer.bzl b/pyoxidizer.bzl index f0ced4ae..6904dfcd 100644 --- a/pyoxidizer.bzl +++ b/pyoxidizer.bzl @@ -24,7 +24,7 @@ def make_exe(): # Obtain the default PythonDistribution for our build target. We link this # distribution into our produced executable and extract the Python standard # library from it. - python_dist = default_python_distribution() + python_dist = default_python_distribution(python_version = "3.8") # This function creates a `PythonPackagingPolicy` instance, which # influences how executables are built and how resources are added to the