elevate
elevate copied to clipboard
[Errno 2] No such file or directory
Hey!
This looks pretty awesome will solve a issue I've been having with a app.
I'm having trouble with your example, I get this error after entering my password: /usr/bin/python: can't open file 'test2.py': [Errno 2] No such file or directory
Wondered if you had any ideas?
I'm using Fedora 29 if that helps.
Thanks!
Can you show your code?
Sure I'm using the example:
import os
from elevate import elevate
def is_root():
return os.getuid() == 0
print("before ", is_root())
elevate()
print("after ", is_root())
I've found part of the answer if I run it using the full path:
python /home/joel/test2.py
It works, is this a requirement?
Ah, I think that's a bug, let me see if I can write a fix.
can you update the code for PyPi so no one ever run into that problem installing elevate with pip?
@derVedro that pull which fixes this (#4) hasn't been merged yet, and unfortunately isn't released yet. You can clone my branch with the fix for now though.
@catb0t I think this never was released on PyPi. Should I continue using your branch for this fix or will it be released
@catb0t I think this never was released on PyPi. Should I continue using your branch for this fix or will it be released
See the discussion between Barney and I in #4. His equivalent, but better version of my branch is on the cwd_and_abs_paths branch of this repository, I suggest you clone and use that one, because it will (probably) be merged into master here eventually.