-
Notifications
You must be signed in to change notification settings - Fork 110
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
argcomplete still doesn't work for me :-/ please help #4538
Comments
You example works for me:
That is with argcomplete 1.11.1 in a virtualenv and on the same datalad commit as you report.
I don't know offhand what's expected, but I see an exit of 1:
|
FTR: It works for me too |
I have obscured my post with not showing run with out -l 1 -- it is totally blank.
and in your case I guess it produces some valuable output, correct? |
FWIW the same with argcomplete 1.11.1 |
It's empty on my end. (edit: That was not a clear way to say that. I see no output.) |
How about when you run with
|
aha -- that reveals something!: (git)lena:~datalad/datalad-maint[maint]git
$> source tools/cmdline-completion
I: Enabling support of bash completions for zsh
$> _ARC_DEBUG=1 _ARGCOMPLETE=1 datalad --help
Unable to open fd 8 for writing, quitting Let's proceed on kislyuk/argcomplete#303 |
thanks to the guidance in aforementioned issue, I found the rabbit hole:
and reached to the bottom of it in a painful succession with the following helper diff on cmd.py (let it never come useful again!)diff --git a/datalad/cmd.py b/datalad/cmd.py
index b34c5f219..be564a49e 100644
--- a/datalad/cmd.py
+++ b/datalad/cmd.py
@@ -946,6 +946,33 @@ class Runner(object):
self._log_err(out[1], expected=expect_stderr)
if status not in [0, None]:
+ """Something in popen_env flips git to segfault!"""
+ def doit(keys):
+ kw = dict(
+ stdout = outputstream, stderr = errstream,
+ shell = shell, cwd = popen_cwd,
+ stdin = stdin
+ )
+
+ _p = subprocess.Popen(
+ cmd,
+ env={k: popen_env[k] for k in keys},
+ **kw);
+ _out = _p.communicate();
+ _status = _p.poll();
+ return _status
+
+ all_keys = list(popen_env.keys())
+ _status = doit(all_keys)
+ assert _status < 0
+ for _i in range(len(popen_env)):
+ _m = -(1+_i)
+ if doit(all_keys[:_m]) == 0 :
+ import epdb; epdb.serve()
+ print(_m, "good! next one was %s" % all_keys[:_m+1][-1])
+ else:
+ print(_m, "still bad")
+
exc = CommandError(
cmd=cmd,
code=status,
which resulted in a bug report against git-annex: https://git-annex.branchable.com/bugs/standalone_shim_is_segfaulting_if_IFS__61____36____39____92__013__39__/ which can be summarized as
and which explains why you could not reproduce my pain (nobody used standalone git annex). I now wonder: shouldn't we filter out IFS (and may be some other env vars) from the "outside" environment (still allowing them to be defined explicit) which we pass into underlying commands? |
it works for me now (that standalone build is fixed) and nobody got excited about IFS, so let's close |
#4477 fixed it up but I still can't get it working, looking for advice and comparison on how to troubleshoot.
so that one exits with -1 -- is that what you see too? is that expected?
my argcomplete:
The text was updated successfully, but these errors were encountered: