mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Avoid truncating EXTERNALLY-MANAGED error message (#2073)
## Summary
This is still imperfect, since the INI parser seems to strip empty
lines, but at least the content is preserved.
Closes https://github.com/astral-sh/uv/issues/2061.
## Test Plan

This commit is contained in:
parent
1f19ef670b
commit
2838542ade
1 changed files with 5 additions and 2 deletions
|
@ -279,13 +279,16 @@ impl Interpreter {
|
|||
return None;
|
||||
};
|
||||
|
||||
let Ok(mut ini) = Ini::new_cs().read(contents) else {
|
||||
let mut ini = Ini::new_cs();
|
||||
ini.set_multiline(true);
|
||||
|
||||
let Ok(mut sections) = ini.read(contents) else {
|
||||
// If a file exists but is not a valid INI file, we assume the environment is
|
||||
// externally managed.
|
||||
return Some(ExternallyManaged::default());
|
||||
};
|
||||
|
||||
let Some(section) = ini.get_mut("externally-managed") else {
|
||||
let Some(section) = sections.get_mut("externally-managed") else {
|
||||
// If the file exists but does not contain an "externally-managed" section, we assume
|
||||
// the environment is externally managed.
|
||||
return Some(ExternallyManaged::default());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue