diff --git a/Lib/os.py b/Lib/os.py index 6e6db96b3071f9..52cbc5bc85864e 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -832,6 +832,7 @@ def reload_environ(): env_data.clear() env_data.update(data) + __all__.append("reload_environ") def getenv(key, default=None): """Get an environment variable, return None if it doesn't exist. diff --git a/Lib/test/test_profiling/test_sampling_profiler.py b/Lib/test/test_profiling/test_sampling_profiler.py index cbfb21d3512eee..5b924cb24531b6 100644 --- a/Lib/test/test_profiling/test_sampling_profiler.py +++ b/Lib/test/test_profiling/test_sampling_profiler.py @@ -2093,6 +2093,8 @@ def test_script_error_treatment(self): ) output = result.stdout + result.stderr + if "PermissionError" in output: + self.skipTest("Insufficient permissions for remote profiling") self.assertNotIn("Script file not found", output) self.assertIn("No such file or directory: 'nonexistent_file.txt'", output) diff --git a/Misc/NEWS.d/next/Library/2025-10-29-16-12-41.gh-issue-120057.qGj5Dl.rst b/Misc/NEWS.d/next/Library/2025-10-29-16-12-41.gh-issue-120057.qGj5Dl.rst new file mode 100644 index 00000000000000..f6b42be1fbf50d --- /dev/null +++ b/Misc/NEWS.d/next/Library/2025-10-29-16-12-41.gh-issue-120057.qGj5Dl.rst @@ -0,0 +1 @@ +Add :func:`os.reload_environ` to ``os.__all__``.