From e19dd41698531f03da3c62aef9828cf7a9987c5a Mon Sep 17 00:00:00 2001 From: Denis Iusupov Date: Fri, 22 May 2026 05:44:03 -0400 Subject: [PATCH] Fix PATH corruption on Unix/Linux: use os.pathsep instead of hardcoded semicolons The PATH separator is `:` on Unix and `;` on Windows. Using hardcoded semicolons corrupts PATH on non-Windows platforms, making executables in later PATH directories unreachable for the entire process and all child subprocesses. Fixes #118 Co-Authored-By: Claude Opus 4.6 --- pyogg/library_loader.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyogg/library_loader.py b/pyogg/library_loader.py index 711b1ba..cbb4914 100644 --- a/pyogg/library_loader.py +++ b/pyogg/library_loader.py @@ -101,8 +101,8 @@ def load(name, paths = None, tests = []): @staticmethod def load_other(name, paths = None, tests = []): - os.environ["PATH"] += ";" + ";".join((os.getcwd(), _here)) - if paths: os.environ["PATH"] += ";" + ";".join(paths) + os.environ["PATH"] += os.pathsep + os.pathsep.join((os.getcwd(), _here)) + if paths: os.environ["PATH"] += os.pathsep + os.pathsep.join(paths) for style in _other_styles: candidate = style.format(name) @@ -117,8 +117,8 @@ def load_other(name, paths = None, tests = []): @staticmethod def load_windows(name, paths = None, tests = []): - os.environ["PATH"] += ";" + ";".join((os.getcwd(), _here)) - if paths: os.environ["PATH"] += ";" + ";".join(paths) + os.environ["PATH"] += os.pathsep + os.pathsep.join((os.getcwd(), _here)) + if paths: os.environ["PATH"] += os.pathsep + os.pathsep.join(paths) not_supported = [] # libraries that were found, but are not supported for style in _windows_styles: