Summary
The SystemDictionary.fetch() method in src/atsphinx/lindera/splitter.py currently calls requests.get() without a timeout and does not call raise_for_status().
This can cause the following issues:
- A slow or failed response from GitHub Releases will stall
sphinx-build indefinitely.
- Non-200 HTTP responses (e.g. 404 for an unsupported dict version) silently fall through to ZIP parsing, resulting in a confusing
BadZipFile error instead of a clear network error.
Suggested fix
- Add a
timeout parameter to requests.get() (e.g. timeout=(5, 60)).
- Call
res.raise_for_status() immediately after the request to surface HTTP errors early.
- Optionally, wrap the network call in a
try/except requests.RequestException block to provide a user-friendly error message.
- Also rename the local variable
zip to avoid shadowing the Python built-in.
References
Reported by @attakei
Summary
The
SystemDictionary.fetch()method insrc/atsphinx/lindera/splitter.pycurrently callsrequests.get()without a timeout and does not callraise_for_status().This can cause the following issues:
sphinx-buildindefinitely.BadZipFileerror instead of a clear network error.Suggested fix
timeoutparameter torequests.get()(e.g.timeout=(5, 60)).res.raise_for_status()immediately after the request to surface HTTP errors early.try/except requests.RequestExceptionblock to provide a user-friendly error message.zipto avoid shadowing the Python built-in.References
Reported by @attakei