Decorator elevate_as_needed now respects .nonadmin#454
Conversation
|
@jaimergp after I had a discussion with @marcoesters we changed the implementation to be Windows only. On Linux, if you install with sudo/root privileges, you're expected to also remove the package with sudo/root. Otherwise you will end-up with permission related issues. For example, with this fix, if you run |
marcoesters
left a comment
There was a problem hiding this comment.
I think that works and makes shortcuts on Windows more predictable. I'd like to get @jaimergp's input though before merging.
| self.mode = "user" | ||
| self.name = "Test" | ||
| self.prefix = Path(prefix_path) | ||
| self.base_prefix = Path(prefix_path).parent |
There was a problem hiding this comment.
This is usually two parents up (because of the envs/ directory). This doesn't matter for the test, though, right?
There was a problem hiding this comment.
Good point, and yeah it does not matter for the purpose of testing since we are more or less just "mocking" it.
Description
This PR resolves: #453.
The
@elevate_as_neededdecorator ignored the.nonadminmarker file whenuser_is_admin()returnedTrue, always using system mode.This caused shortcuts to be created in the system location (ProgramData) instead of the user location (AppData) for per-user installs running in an elevated context.
The fix checks for
.nonadminbefore defaulting to system mode when admin.Checklist - did you ...
newsdirectory (using the template) for the next release's release notes?