First, a thank you for the project; I've been looking into integrating argcomplete into ipython/traitlets#811 so that shell completion works "out-of-the-box" for IPython, Jupyter, and everything else in the ecosystem.
Currently in CompletionFinder.__init__(), the following is done:
Could this behavior be made optional? I think it could either be extracted out into a separate helper method that can be overridden, or perhaps be controlled by either an additional argument (similar to output_stream=) or environment variable. Feel free to let me know which (or both) is preferable, and I can open a PR.
Thanks for looking into this. I am open to making the debug stream initialization optional by breaking it out into a method that can be disabled in subclasses. Would you be interested in creating a PR for that?
First, a thank you for the project; I've been looking into integrating
argcomplete
into ipython/traitlets#811 so that shell completion works "out-of-the-box" for IPython, Jupyter, and everything else in the ecosystem.Currently in
CompletionFinder.__init__()
, the following is done:Could this behavior be made optional? I think it could either be extracted out into a separate helper method that can be overridden, or perhaps be controlled by either an additional argument (similar to
output_stream=
) or environment variable. Feel free to let me know which (or both) is preferable, and I can open a PR.The problem is that this file descriptor could be used elsewhere, for example by pytest, leading to obscure failures. You can find a MRE in https://github.com/ipython/traitlets/pull/815/commits/2654e3feb9e152148a519c47a73200b9bd683133. I was able to get around this for now by
mock
-ingos.fdopen
https://github.com/ipython/traitlets/pull/811/commits/0deadccc0adc0d9a91a15fe8790f2b7c5c8831a9, but I'd prefer not to have to introduce mocking if possible.I think this was also identified as one of two issues in #365 but was closed since the other half was resolved.