8000 gh-119574: Add some missing environment variables to '--help-env'. by devdanzin · Pull Request #120006 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-119574: Add some missing environment variables to '--help-env'. #120006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove PYTHONEXECUTABLE from --help-env.
  • Loading branch information
devdanzin committed Jun 18, 2024
commit 82aecfb3dd9f68176b8d8b129ad2d489c68e6863
11 changes: 2 additions & 9 deletions Lib/test/test_cmd_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,21 +934,14 @@ def test_python_dump_refs_file(self):
contents = file.read()
self.assertIn('Remaining objects', contents)

@unittest.skipUnless(sys.platform == 'darwin', 'PYTHONEXECUTABLE only works on macOS')
def test_python_executable(self):
code = 'import sys; print(sys.executable)'
expected = "/busr/bbin/bpython"
rc, out, err = assert_python_ok('-c', code, PYTHONEXECUTABLE=expected)
self.assertIn(expected.encode(), out)

@unittest.skipUnless(sys.platform == 'win32', 'Test only applicable on Windows')
@unittest.skipUnless(support.MS_WINDOWS, 'Test only applicable on Windows')
def test_python_legacy_windows_fs_encoding(self):
code = "import sys; print(sys.getfilesystemencoding())"
expected = 'mbcs'
rc, out, err = assert_python_ok('-c', code, PYTHONLEGACYWINDOWSFSENCODING='1')
self.assertIn(expected.encode(), out)

@unittest.skipUnless(sys.platform == 'win32', 'Test only applicable on Windows')
@unittest.skipUnless(support.MS_WINDOWS, 'Test only applicable on Windows')
def test_python_legacy_windows_stdio(self):
code = "import sys; print(sys.stdin.encoding, sys.stdout.encoding)"
expected = 'cp'
Expand Down
3 changes: 0 additions & 3 deletions Python/initconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@ static const char usage_envvars[] =
"PYTHONDUMPREFS : dump objects and reference counts still alive after shutdown\n"
"PYTHONDUMPREFSFILE: dump objects and reference counts to the specified file\n"
#endif
#ifdef __APPLE__
"PYTHONEXECUTABLE: set sys.argv[0] to this value (macOS only)\n"
#endif
#ifdef MS_WINDOWS
"PYTHONLEGACYWINDOWSFSENCODING: use legacy \"mbcs\" encoding for file system\n"
"PYTHONLEGACYWINDOWSSTDIO: use legacy Windows stdio\n"
Expand Down
Loading
0