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
When wrapping a put(x, y, use_sudo=True) call within a with cd(): block, the hidden sudo(mv) call inside put (which moves the file from its temp location to the final destination) is honoring the cd prefix. The mv call uses a relative path in its first argument (I assume because we didn't want to specify an absolute remote temporary location?) and is thus in the wrong directory when it actually runs.
The obvious solution is to use an absolute path for the use_sudo=True temporary location. So either assume the remote system has a /tmp, or (probably better) determine the remote user's home directory as an absolute path, and then use that explicitly instead of implicitly.
Submitted by irc user dsx4ever / Egor M.
Originally submitted by Jeff Forcier (bitprophet) on 2011-04-25 at 09:06pm EDT
This also effects, by proxy, upload_template when used in the same situation (inside cd, and using use_sudo=True.) Confirmed report from IRC user easylancer.
Description
When wrapping a
put(x, y, use_sudo=True)
call within awith cd():
block, the hiddensudo(mv)
call insideput
(which moves the file from its temp location to the final destination) is honoring thecd
prefix. Themv
call uses a relative path in its first argument (I assume because we didn't want to specify an absolute remote temporary location?) and is thus in the wrong directory when it actually runs.The obvious solution is to use an absolute path for the
use_sudo=True
temporary location. So either assume the remote system has a/tmp
, or (probably better) determine the remote user's home directory as an absolute path, and then use that explicitly instead of implicitly.Submitted by irc user
dsx4ever
/ Egor M.Originally submitted by Jeff Forcier (bitprophet) on 2011-04-25 at 09:06pm EDT
Relations
The text was updated successfully, but these errors were encountered: