Open gaurav-95 opened 2 years ago
Thanks for reporting @gaurav-95. So to be clear, the print(result)
line actually prints? But then the closing of the with
statement hangs?
@gaurav-95 I just tried running this on my machine and it runs fine - result is printed, and nothing freezes. Please reopen if you're still having issues.
Will check again and post output.
Yes, i can confirm that the output gets printed but the code keeps running on the terminal. It does not finish/ exit from runtime.
I think we can diagnose this issue as: self._terminate_server()
not killing server on Windows. That's the most likely cause.
It's difficult for me to debug without a windows machine...
I see, my bad to not mention I was running on windows beforehand.
@jxmorris12 - I'm not getting any hard freezes on Windows 10, but I do have a likely-related problem where the java.exe process never ends even after IDLE is closed.
At one point I ended up with 20+ java.exe processes running hours after I had finished what I was doing.
Also, each Java process that's running seems to make the script's startup slower. It flashes a window briefly at the bottom of Windows one time for every current process, so if you have 10 java.exe processes running then it'll flash 10 times before the language tool object is successfully created.
Here's the only code required to reproduce the issue:
tool = language_tool_python.LanguageTool('en-US')
@Pikamander2 thanks for reporting, this is a serious issue. Are you running that code in a script? Or through the python IDLE?
@jxmorris12 - I just tested out the process bug in both CMD and IDLE and it looks like this bug also only occurs with IDLE.
In regards to Windows testing, one option that you could try is to run an evaluation copy of Windows in a virtual machine. Alternatively, a Windows VPS is about $5 per month.
This SO answer looks relevant: https://stackoverflow.com/a/55411153/2287177
Sorry for reviving this, I might have some info that can help.
I see this hanging issue upon calling tool.close()
in WSL and in the pydev debugger on top of the previously mentioned terminals.
Weird that this works on my linux machine but not in WSL (running Ubuntu 20)
This is my code, I am adding bullets wherever there is a new line and then trying to get spell-checked texts stored in res
I get an output of the corrected text. But there is no error, no other output. Just freezes there. I tried giving explicit close and using with statement as well to no avail.