You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to manipulate a users crontab with an invoke task. Direct access to a crontab is not allowed, so you have to use the crontab-tool. The process is simple: use crontab -l to read the contents. manipulate it and write is back using (basically) echo "new-contents" | crontab.
When using the in_stream-parameter to ctx.run with the new contents (in a StringIO object), the invoke task hangs. Using strace on the process I can see that it's waiting on input.
A simple implementation using subprocess.Popen works perfectly.
It's very easy to reproduce (this will overwrite your local crontab, make sure it doesn't contain anything important!):
I'm trying to manipulate a users crontab with an invoke task. Direct access to a crontab is not allowed, so you have to use the
crontab
-tool. The process is simple: usecrontab -l
to read the contents. manipulate it and write is back using (basically)echo "new-contents" | crontab
.When using the
in_stream
-parameter toctx.run
with the new contents (in aStringIO
object), the invoke task hangs. Using strace on the process I can see that it's waiting on input.A simple implementation using
subprocess.Popen
works perfectly.It's very easy to reproduce (this will overwrite your local crontab, make sure it doesn't contain anything important!):
Python 2 (.7) or Python 3 (.6) makes no difference. Also the fix-everything-pty=true trick didn't help.
Maybe I don't understand how to use the
in_stream
parameter or this may not be the intended use, but I'd love some feedback!The text was updated successfully, but these errors were encountered: