Skip to content

Commit 847c507

Browse files
harkrish-1claude
andcommitted
Fix pip config parsing for multiple extra-index-urls
When pip config contains multiple extra-index-urls, `pip config list` outputs them separated by literal `\n` characters. The previous regex only split on whitespace, so multiple URLs were treated as a single mangled value. Split on literal `\n` as well. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6ebc3e4 commit 847c507

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

metaflow/plugins/pypi/pip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def indices(self, prefix):
324324
key, value = line.split("=", 1)
325325
_, key = key.split(".")
326326
if key in ("index-url", "extra-index-url"):
327-
values = map(lambda x: x.strip("'\""), re.split("\s+", value, re.M))
327+
values = map(lambda x: x.strip("'\""), re.split(r"\\n|\s+", value, re.M))
328328
(indices if key == "index-url" else extra_indices).extend(values)
329329
except Exception:
330330
pass

0 commit comments

Comments
 (0)