Skip to content
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

Confusion with relative path and _cwd #372

Closed
terhorst opened this issue Mar 13, 2017 · 1 comment
Closed

Confusion with relative path and _cwd #372

terhorst opened this issue Mar 13, 2017 · 1 comment
Labels

Comments

@terhorst
Copy link

terhorst commented Mar 13, 2017

Not sure if this is a bug, but I ran into this issue when trying to a call a script which needs the working directory to be the same as the directory in which it lives:

>>> script = sim.Command("relative/path/script.sh").bake(_cwd="relative/path")
>>> script()
sh.ErrorReturnCode_255:
[snip]

The shell seems to be unable to actually find the script, and returns 255. Passing in the absolute path, i.e.

>>> sim.Command(os.path.abspath("relative/path/script.sh")).bake(_cwd="relative/path")

has the expected behavior.

@amoffat amoffat added the bug label Mar 14, 2017
@amoffat
Copy link
Owner

amoffat commented Mar 14, 2017

Fixed in 1.12.11, thanks for reporting

@amoffat amoffat closed this as completed Mar 14, 2017
0-wiz-0 added a commit to NetBSD/pkgsrc-wip that referenced this issue Apr 19, 2017
*   pypi readme doc bugfix [PR#377](amoffat/sh#377)

*   bugfix for relative paths to `sh.Command` not expanding to absolute paths [#372](amoffat/sh#372)
*   updated for python 3.6
*   bugfix for SIGPIPE not being handled correctly on pipelined processes [#373](amoffat/sh#373)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants