New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lcd() context with local() and CDPATH includes output of cd command #980

Closed
erlkonig opened this Issue Sep 13, 2013 · 2 comments

Comments

Projects
None yet
2 participants
@erlkonig

erlkonig commented Sep 13, 2013

When using something like

with lcd(target_dir):
       output = local('...........')

while the environment variable CDPATH is present, Bash will output what directory it ends up in the target_dir was a simple name (no slashes). The docs (for cd()) suggest that running a command ends up doing "cd target_dir && command", but if CDPATH is present the model would need to be "cd target_dir >/dev/null && command" to be reliable. Otherwise the command's output will have a generally unanticipated prefixed directory name, and horribly break some fab jobs for only certain users.

Alternatively, fab could unset CDPATH by default, and be documented as doing so, though there is a small chance some nutter is using that extra output deliberately.

@sivy sivy added the Needs patch label Apr 13, 2015

@sivy

This comment has been minimized.

sivy commented Apr 13, 2015

This is probably ok, but need to look at how cd and lcd are implemented to see how large a change this is.

@sivy

This comment has been minimized.

sivy commented Apr 13, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment