diff --git a/CHANGELOG.md b/CHANGELOG.md index 5791f7092..94d3db159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2 ### Changed - ControlNet model selector will now show the parent directory of a model when relevant ### Fixed -- Fixed Python Packages dialog crash +- Fixed Python Packages dialog crash due to pip commands including warnings - Fixed Base Model downloads from the Hugging Face tab downloading to the wrong folder ## v2.7.5 diff --git a/StabilityMatrix.Core/Python/PipShowResult.cs b/StabilityMatrix.Core/Python/PipShowResult.cs index 4bc132fe0..15e86cfcd 100644 --- a/StabilityMatrix.Core/Python/PipShowResult.cs +++ b/StabilityMatrix.Core/Python/PipShowResult.cs @@ -29,7 +29,9 @@ public static PipShowResult Parse(string output) // Decode each line by splitting on first ":" to key and value var lines = output .SplitLines(StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries) - .Select(line => line.Split(new[] { ':' }, 2)) + // Filter warning lines + .Where(line => !line.StartsWith("WARNING", StringComparison.OrdinalIgnoreCase)) + .Select(line => line.Split(':', 2)) .Where(split => split.Length == 2) .Select(split => new KeyValuePair(split[0].Trim(), split[1].Trim())) .ToDictionary(pair => pair.Key, pair => pair.Value); @@ -46,11 +48,11 @@ public static PipShowResult Parse(string output) Location = lines.GetValueOrDefault("Location"), Requires = lines .GetValueOrDefault("Requires") - ?.Split(new[] { ',' }, StringSplitOptions.TrimEntries) + ?.Split(',', StringSplitOptions.TrimEntries) .ToList(), RequiredBy = lines .GetValueOrDefault("Required-by") - ?.Split(new[] { ',' }, StringSplitOptions.TrimEntries) + ?.Split(',', StringSplitOptions.TrimEntries) .ToList() }; }