From 1ab43bdc12babb22e8b76c5251f2db8c108d23da Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 7 Jan 2024 19:52:57 +0200 Subject: [PATCH] Fix KeyError: 'content-length' --- ChangeLog.txt | 4 ++++ slpkg/check_updates.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 39770e60..7ddd42f3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,9 @@ ## slpkg - ChangeLog +### 4.9.7 - 07/01/2024 +- Fixed: + * Fix urllib3 KeyError: 'content-length' + ### 4.9.6 - 16/12/2023 - Added: * slackdce repository (Thanks to rizitis) diff --git a/slpkg/check_updates.py b/slpkg/check_updates.py index 7cf1799c..34bb9f2d 100644 --- a/slpkg/check_updates.py +++ b/slpkg/check_updates.py @@ -110,7 +110,7 @@ class CheckUpdates(Configs): f'Failed to connect to {repo_chg_txt}\n') repo_size: int = 0 else: - repo_size: int = int(repo.headers['Content-Length']) + repo_size: int = int(repo.headers.get('content-length')) if local_chg_txt.is_file(): local_size: int = int(os.stat(local_chg_txt).st_size)