Skip to content
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

Initial download is extremely slow and times out in IDLE #57

Open
Pikamander2 opened this issue Apr 29, 2022 · 4 comments
Open

Initial download is extremely slow and times out in IDLE #57

Pikamander2 opened this issue Apr 29, 2022 · 4 comments
Labels
bug Something isn't working IDLE bugs that only occur in python IDLE Windows bugs that only apply to Windows

Comments

@Pikamander2
Copy link

When run in IDLE for the first time (at least on Windows), the tool floods the IDLE shell with thousands of download progress messages and gradually grind to a halt until it reaches several bytes per second and eventually fails.

It works flawlessly in cmd/terminal, but it would be nice if it worked correctly in IDLE as well. I realize that IDLE has a lot of issues and may or may not be worth fully supporting, but currently there's not even any indication to the user about what the problem is.

@Pikamander2
Copy link
Author

@jxmorris12
Copy link
Owner

@jxmorris12
Copy link
Owner

But that's just about the progress bar. The command shouldn't fail. @Pikamander2 can you post the error message if there is one?

@Pikamander2
Copy link
Author

Pikamander2 commented May 1, 2022

@jxmorris12 - Just tested it on a different setup (Windows 7 + IDLE 3.8.9 whereas last time I used Windows 10 + IDLE 3.9.0) and the exact same thing happened. The download rate starts out at a reasonable value but then rapidly deteriorates down to a few KB/s and eventually just a few bytes per second. After about 10-20 minutes, it finally fails with a zipfile.BadZipFile error:

Unzipping C:\Users\MyUser\AppData\Local\Temp\tmpl84l608i.zip to C:\Users\MyUser\.cache\language_tool_python.
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    tool = language_tool_python.LanguageTool('en-US')
  File "C:\Program Files\Python38\lib\site-packages\language_tool_python\server.py", line 62, in __init__
    self._start_server_on_free_port()
  File "C:\Program Files\Python38\lib\site-packages\language_tool_python\server.py", line 238, in _start_server_on_free_port
    self._start_local_server()
  File "C:\Program Files\Python38\lib\site-packages\language_tool_python\server.py", line 248, in _start_local_server
    download_lt()
  File "C:\Program Files\Python38\lib\site-packages\language_tool_python\download_lt.py", line 154, in download_lt
    download_zip(language_tool_download_url, download_folder)
  File "C:\Program Files\Python38\lib\site-packages\language_tool_python\download_lt.py", line 129, in download_zip
    unzip_file(downloaded_file, directory)
  File "C:\Program Files\Python38\lib\site-packages\language_tool_python\download_lt.py", line 117, in unzip_file
    with zipfile.ZipFile(temp_file.name, 'r') as zip_ref:
  File "C:\Program Files\Python38\lib\zipfile.py", line 1269, in __init__
    self._RealGetContents()
  File "C:\Program Files\Python38\lib\zipfile.py", line 1336, in _RealGetContents
    raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

Screenshots of the gradually slowing download rate and messy output: https://imgur.com/a/e5uK0YQ

Here's the code I used:

Command line:
pip install language-tool-python

IDLE:
import language_tool_python
tool = language_tool_python.LanguageTool('en-US')

The issue should be reproducible on any Windows + IDLE setup in which the LanguageTool files have not yet been downloaded.

@jxmorris12 jxmorris12 added bug Something isn't working IDLE bugs that only occur in python IDLE Windows bugs that only apply to Windows labels Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working IDLE bugs that only occur in python IDLE Windows bugs that only apply to Windows
Projects
None yet
Development

No branches or pull requests

2 participants