From c01fade7c152449216a56a19aed83b7f2810fd06 Mon Sep 17 00:00:00 2001 From: Michael Neeley Date: Wed, 22 Jan 2025 10:15:03 -0500 Subject: [PATCH 1/3] Switch False gzip Error to Warning By logging errors, events get sent to analytics captures (like Sentry) that aren't actually a problem since the usp can continue to parse the non-gzipped data --- usp/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usp/helpers.py b/usp/helpers.py index 9f729f6..98724d6 100644 --- a/usp/helpers.py +++ b/usp/helpers.py @@ -247,7 +247,7 @@ def ungzipped_response_content( data = gunzip(data) except GunzipException as ex: # In case of an error, just assume that it's one of the non-gzipped sitemaps with ".gz" extension - log.error( + log.warn( f"Unable to gunzip response {response}, maybe it's a non-gzipped sitemap: {ex}" ) From 87a284c984dc57a12f45f8667078545730aef2e0 Mon Sep 17 00:00:00 2001 From: Michael Neeley Date: Wed, 22 Jan 2025 10:16:10 -0500 Subject: [PATCH 2/3] Update usp/helpers.py --- usp/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usp/helpers.py b/usp/helpers.py index 98724d6..42a093d 100644 --- a/usp/helpers.py +++ b/usp/helpers.py @@ -247,7 +247,7 @@ def ungzipped_response_content( data = gunzip(data) except GunzipException as ex: # In case of an error, just assume that it's one of the non-gzipped sitemaps with ".gz" extension - log.warn( + log.warning( f"Unable to gunzip response {response}, maybe it's a non-gzipped sitemap: {ex}" ) From efd1dc7c88a84c5204fb50b724aa45dff620ed2a Mon Sep 17 00:00:00 2001 From: Freddy Heppell Date: Thu, 23 Jan 2025 10:35:16 +0000 Subject: [PATCH 3/3] Add changelog entry --- docs/changelog.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 6544453..3f0cc03 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,13 @@ Changelog ========= +Upcoming +-------- + +**Bug Fixes** + +- Changed log level when a suspected gzipped sitemap can't be un-gzipped from `error` to `warning`, since parsing can usually continue (:pr:`62` by :user:`redreceipt`) + v1.1.0 (2025-01-20) -------------------