Closed vietjtnguyen closed 7 years ago
It should be better to use proc = subprocess.Popen(cmd,stdin=subprocess.DEVNULL,stdout=sys.stdout,stderr=sys.stderr)
.
Because the default threading sources already have this behavior.
This update came up to me a few times. But after a wile I forgot to chage it.
Thanks.
You mean changing it permanently to share stdout
and stderr
instead of putting it behind an environment variable?
You mean changing it permanently to share stdout and stderr instead of putting it behind an environment variable?
Yes
One problem with that is there are a few RuntimeWarning
messages that come through stderr
and show up as scary looking things when neovim gets started up:
Here's the text:
Error detected while processing function <SNR>93_on_core_channel_error:
line 1:
/home/vnguyen/.config/nvim/bundle/clang_complete/pythonx/cm_sources/clang_complete.py:9: Runt
imeWarning: Parent module 'cm_sources' not found while handling absolute import^@ from cm im
port register_source, getLogger, Base^@/home/vnguyen/.config/nvim/bundle/clang_complete/pytho
nx/cm_sources/clang_complete.py:20: RuntimeWarning: Parent module 'cm_sources' not found whil
e handling absolute import^@ import sys^@/home/vnguyen/.config/nvim/bundle/clang_complete/py
thonx/cm_sources/clang_complete.py:21: RuntimeWarning: Parent module 'cm_sources' not found w
hile handling absolute import^@ import os^@/home/vnguyen/.config/nvim/bundle/clang_complete/
pythonx/cm_sources/clang_complete.py:22: RuntimeWarning: Parent module 'cm_sources' not found
while handling absolute import^@ import libclang^@
I haven't spent the time to understand if they're normal or if I need to pay attention to them (since things are working).
Prepending from __future__ import absolute_import
to pythonx/cm_sources/clang_complete.py
seems to fix this issue.
Yep, so it does. Want me to simplify this pull request to just turn on the stdout
and stderr
sharing and open another one for the from __future__ import absolute_import
change to your clang_complete fork?
Merged.
Thanks.
This is a result of my effort detailed in https://github.com/roxma/clang_complete/pull/6
I found it useful to get the
stdout
andstderr
from the source processes to debug why a source process might be dead. I figure being able to enable/disable that without a source change would be a convenient addition to the trouble shooting wiki.Feel free to bike shed names and whatnot.