gh-98414: py.exe launcher does not use defaults for -V:company/ option (GH-98460)

This commit is contained in:
Steve Dower 2022-10-19 23:00:09 +01:00 committed by GitHub
parent 9c8dde0fa5
commit 4bd63f66cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View File

@ -369,6 +369,13 @@ class TestLauncher(unittest.TestCase, RunPyMixin):
self.assertEqual(company, data["env.company"]) self.assertEqual(company, data["env.company"])
self.assertEqual("3.100", data["env.tag"]) self.assertEqual("3.100", data["env.tag"])
def test_filter_to_company_with_default(self):
company = "PythonTestSuite"
data = self.run_py([f"-V:{company}/"], env=dict(PY_PYTHON="3.0"))
self.assertEqual("X.Y.exe", data["LaunchCommand"])
self.assertEqual(company, data["env.company"])
self.assertEqual("3.100", data["env.tag"])
def test_filter_to_tag(self): def test_filter_to_tag(self):
company = "PythonTestSuite" company = "PythonTestSuite"
data = self.run_py([f"-V:3.100"]) data = self.run_py([f"-V:3.100"])

View File

@ -0,0 +1,3 @@
Fix :file:`py.exe` launcher handling of ``-V:<company>/`` option when
default preferences have been set in environment variables or configuration
files.

View File

@ -653,6 +653,7 @@ parseCommandLine(SearchInfo *search)
search->tag = argStart; search->tag = argStart;
} }
search->tagLength = (int)(tail - search->tag); search->tagLength = (int)(tail - search->tag);
search->allowDefaults = false;
search->restOfCmdLine = tail; search->restOfCmdLine = tail;
} else if (MATCHES(L"0") || MATCHES(L"-list")) { } else if (MATCHES(L"0") || MATCHES(L"-list")) {
search->list = true; search->list = true;