diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 75b2aee46..353984b14 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1940,7 +1940,7 @@ class NinjaBackend(backends.Backend): from_subproject: bool, proc_macro_dylib_path: T.Optional[str], deps: T.List[RustDep]) -> None: raw_edition: T.Optional[str] = mesonlib.first(reversed(args), lambda x: x.startswith('--edition')) - edition: RUST_EDITIONS = '2015' if not raw_edition else raw_edition.split('=')[-1] + edition: RUST_EDITIONS = '2015' if not raw_edition else raw_edition.split('=', 1)[-1] cfg: T.List[str] = [] arg_itr: T.Iterator[str] = iter(args) diff --git a/mesonbuild/dependencies/pkgconfig.py b/mesonbuild/dependencies/pkgconfig.py index 65ac659b5..4d30e4388 100644 --- a/mesonbuild/dependencies/pkgconfig.py +++ b/mesonbuild/dependencies/pkgconfig.py @@ -553,7 +553,7 @@ class PkgConfigDependency(ExternalDependency): def extract_field(self, la_file: str, fieldname: str) -> T.Optional[str]: with open(la_file, encoding='utf-8') as f: for line in f: - arr = line.strip().split('=') + arr = line.strip().split('=', 1) if arr[0] == fieldname: return arr[1][1:-1] return None diff --git a/run_unittests.py b/run_unittests.py index 6a84f5c05..81c0b073e 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -59,7 +59,7 @@ def setup_backend(): be = 'ninja' for a in sys.argv: if a.startswith('--backend'): - be = a.split('=')[1] + be = a.split('=', 1)[1] else: filtered.append(a) # Since we invoke the tests via unittest or xtest test runner diff --git a/test cases/common/49 custom target/my_compiler.py b/test cases/common/49 custom target/my_compiler.py index a32cbdbba..c4c8d72c6 100755 --- a/test cases/common/49 custom target/my_compiler.py +++ b/test cases/common/49 custom target/my_compiler.py @@ -13,10 +13,10 @@ if __name__ == '__main__': not args[2].startswith('--output'): print(args[0], '--input=input_file --output=output_file') sys.exit(1) - with open(args[1].split('=')[1]) as f: + with open(args[1].split('=', 1)[1]) as f: ifile = f.read() if ifile != 'This is a text only input file.\n': print('Malformed input') sys.exit(1) - with open(args[2].split('=')[1], 'w') as ofile: + with open(args[2].split('=', 1)[1], 'w') as ofile: ofile.write('This is a binary output file.\n')