-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Watch mode repeatedly prints Error returned from file system watcher.
when virtual env is inside the directory being analyzed
#5415
Comments
Error returned from file system watcher.
Error returned from file system watcher.
when virtual env is inside the directory being analyzed
Piping through the excludes is not a proper solution. Excluded files and directories may still be imported by included files, so they should be retained as part of the files system watcher. The problem here is that MacOS doesn't support recursive file system watchers like Linux and Windows do. |
Upon further investigation, it looks like the problem could be that
I don't have much TS experience so I don't know what's going on here. I do see that |
Ah, this is an issue in the Python wrapper right? I will report this issue over there. |
I was incorrect above when I said that "MacOS doesn't support recursive file system watchers". It does support recursive file watching via the "fsevents" API. Chokidar uses this API on MacOS to implement efficient recursive file watching events. I think you may be correct that chokidar is failing to use "fsevents" on your system and is falling back on a technique that doesn't scale well to large file hierarchies. Why do you think this is related to the Python wrapper? Does the problem go away if you install pyright using npm ( |
I didn't try installing through npm, but I did say in the other issue that running |
The python wrapper simply calls |
You are right, |
This is addressed in pyright 1.1.318, which I just published. Thanks @adampauls for your help in identifying a fix! |
Confirmed it is now fixed with me for the released version, thanks! |
Describe the bug
When running
pyright -w
on the command line, it correctly reports some errors then infinitely loops withError returned from file system watcher.
I'm on MacOS 13.4.1 (22F82). Happens both in iTerm2 and in the terminal within PyCharm. Perhaps it's at least worth exposing the error here? I did so manually locally and seeError: EMFILE: too many open files, watch
. It also only happens on larger projects, so this comment might be relevant.UPDATE: I verified that if I manually change this line to
then the problem is resolved. I see that plumbing through
configOptions.exclude
to the file system watcher constructor is not trivial, but hopefully someone more familiar with the code can do it quickly.VS Code extension or command-line
pyright 1.1.316 from the command line.
Additional context
Only instance of the error message I could find on a Google search was this bug.
The text was updated successfully, but these errors were encountered: