Comments (5)
Will look to implement something similar to here: https://fangpenlin.com/posts/2012/08/26/good-logging-practice-in-python/
Sensible defaults but read logging config from file if it's available
from python-language-server.
Actually this problem is more serious. autozimu/LanguageClient-neovim#21
It seems writing to stderr blocks writing to stdout.
from python-language-server.
So the problem, as you pointed out, is that languageClient-neovim sets stderr=PIPE
. What is happening is the client blocks waiting to read from stdout, Pyls fills up stderr buffer and blocks waiting to write to stderr and we end up in deadlock.
See here for more explanation:
http://stackoverflow.com/questions/1180606/using-subprocess-popen-for-process-with-large-output
What languageClient-neovim should be doing is use select to read off both stdout and stderr and then throwing away stderr if it doesn't think its relevant. Alternatively it could set stderr=None to just drop it entirely, it could redirect it to appear on the client's stderr, or it could pass in a file object to redirect stderr to disk.
I agree that Pyls should have more configurable logging and will work on implementing that, but it's not in any language server contract that logs cannot be written to stderr.
Equally changing the log level isn't sufficient as in the case there is a lot of ERROR
messages it will still hang! Just happening less frequently.
So I think the solution here is for us to support configurable logging, and to make things easy for clients maybe a command line switch to redirect stderr to a file, but also for languageClient-neovim to properly handle stderr.
from python-language-server.
I don't think LanguageClient is the same as the stackoverflow question.
Actually PYLS blocks at writing to stdout, not stderr. Recorded here autozimu/LanguageClient-neovim#21
Source:
https://github.com/palantir/python-language-server/blob/master/pyls/jsonrpc.py#L155
from python-language-server.
@HerringtonDarkholme would be great to get your thoughts on this PR as a solution: #19
from python-language-server.
Related Issues (20)
- Warning: The engine "vscode" appears to be invalid. HOT 3
- Is this package being deprecated? HOT 4
- Lists are not merged but overriden HOT 1
- AttributeError: 'PosixPath' object has no attribute 'read_text' HOT 2
- Missing support for flake8 --extend-ignore HOT 4
- Unable to start the Python language server
- An issue on workspace/didChangeWorkspaceFolders event HOT 1
- Allow changing severity of flake8 messages HOT 1
- [question] Does python-language-server have a release version suitable for python 3.4? HOT 2
- error pip
- Enable "Discussions"
- Python language server breaks autocomplete on Python 3.11 HOT 4
- Is there a configuration option to enable jumping to `builtin` module stubs? HOT 1
- Crashes due to Pydantic Validation
- Crashes in VS Code due to Pydantic Validation Error HOT 2
- Why no new release after 2020? HOT 1
- Adding from-stdin = false to toml config causes pylint to hang
- How to implement custom completion items through pyi scripts? HOT 1
- Active Fork: python-lsp-server
- mypy cannot locate local packages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-language-server.