Skip to content

Commit 9600935

Browse files
committed
prepare version 3.3.1
1 parent 51262f3 commit 9600935

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

Changes.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v3.3.1 Sun Mar 29 2026
2+
Validate the host domain parameter. Should be opencagedata.com subdomain or localhost
3+
Set explicit timeout for HTTP requests
4+
15
v3.3.0 Tue Feb 17 2026
26
Requires python 3.9
37
Documentation: overhaul, add missing docstrings, use Google-style (a bit more verbose)

opencage/geocoder.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ def _opencage_request(self, params):
341341
UnknownError: If the server returns an error or invalid JSON.
342342
"""
343343
if self.session:
344-
response = self.session.get(self.url, params=params, headers=self._opencage_headers('aiohttp'))
344+
response = self.session.get(self.url, params=params, headers=self._opencage_headers('aiohttp'), timeout=30)
345345
else:
346-
response = requests.get(self.url, params=params, headers=self._opencage_headers('requests'))
346+
response = requests.get(self.url, params=params, headers=self._opencage_headers('requests'), timeout=30)
347347

348348
try:
349349
response_json = response.json()
@@ -408,7 +408,8 @@ async def _opencage_async_request(self, params):
408408
SSLError: If the SSL connection fails.
409409
"""
410410
try:
411-
async with self.session.get(self.url, params=params, ssl=self.sslcontext) as response:
411+
timeout = aiohttp.ClientTimeout(total=30)
412+
async with self.session.get(self.url, params=params, ssl=self.sslcontext, timeout=timeout) as response:
412413
try:
413414
response_json = await response.json()
414415
except ValueError as excinfo:

opencage/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '3.3.0'
1+
__version__ = '3.3.1'

0 commit comments

Comments
 (0)