From 5445084867898412db6ca70136e3e8b3e03107f7 Mon Sep 17 00:00:00 2001 From: Aaron Wilson Date: Fri, 3 Jan 2020 20:36:08 +0000 Subject: [PATCH 1/3] Remove a cross-platform compat bug in python builder python_build.tpl was being referenced in a relative path with raw `../../` rather than using the os.path.join invocation it was _already_ within. I'm guessing someone just didn't have their second coffee that day. --- anaconda_lib/builder/python_builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anaconda_lib/builder/python_builder.py b/anaconda_lib/builder/python_builder.py index 52b01f72..942bf351 100644 --- a/anaconda_lib/builder/python_builder.py +++ b/anaconda_lib/builder/python_builder.py @@ -68,7 +68,7 @@ def _parse_tpl(self, cmd): template_file = os.path.join( os.path.dirname(__file__), - '../../', 'templates', 'python_build.tpl' + '..', '..', 'templates', 'python_build.tpl' ) with open(template_file, 'r', encoding='utf8') as tplfile: template = Template(tplfile.read()) From c1c775f838c8beea7dc83bc86937d54a8008243d Mon Sep 17 00:00:00 2001 From: Aaron Wilson Date: Fri, 3 Jan 2020 21:14:31 +0000 Subject: [PATCH 2/3] fix a windows issue in interpreter.py python_interpreter paths that are fully specified will fail on a urlparse, because it will interpret `drivename:\some\path` as a url with schema `drivename` and path `some\path`. This then causes worker execution to fail with "file not found". --- anaconda_lib/workers/interpreter.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/anaconda_lib/workers/interpreter.py b/anaconda_lib/workers/interpreter.py index 3b8d5d02..8638d22f 100644 --- a/anaconda_lib/workers/interpreter.py +++ b/anaconda_lib/workers/interpreter.py @@ -151,7 +151,13 @@ def __extract_python_interpreter(self, view): os.path.expandvars(get_interpreter(view)) ) ) - python = urldata.path + + if len(urldata.scheme) == 1: + # Assume this comes from a Windows path if schema is a single character + python = os.path.join('{}:'.format(urldata.scheme), urldata.path) + else: + python = urldata.path + if '$VIRTUAL_ENV' in python: Log.warning( 'WARNING: your anaconda configured python interpreter ' From 06a5e0cebcb0a5b050023c0d5ac36289f489ee9c Mon Sep 17 00:00:00 2001 From: Aaron Wilson Date: Tue, 7 Jan 2020 00:30:46 +0000 Subject: [PATCH 3/3] Update interpreter.py --- anaconda_lib/workers/interpreter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anaconda_lib/workers/interpreter.py b/anaconda_lib/workers/interpreter.py index 8638d22f..a86a0d6f 100644 --- a/anaconda_lib/workers/interpreter.py +++ b/anaconda_lib/workers/interpreter.py @@ -153,7 +153,7 @@ def __extract_python_interpreter(self, view): ) if len(urldata.scheme) == 1: - # Assume this comes from a Windows path if schema is a single character + # Assume this comes from a Windows path if scheme is a single character python = os.path.join('{}:'.format(urldata.scheme), urldata.path) else: python = urldata.path