Skip to content

Add timeout and raise_for_status() to SystemDictionary.fetch() #5

Description

@coderabbitai

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions