I was observing the following behaviour:
os.mkdir(path) #all OK operations_that_take_10hrs_to_complete() os.mkdir(path) # permission denied
like I lost my sudo rights after some time ..
This question came from our site for professional and enthusiast programmers.
As stated in the sudo man page, the default timeout is 15 minutes. You can change this timeout in the sudoers file by adding this row (where 30 is half an hour):