grip: patch for Werkzeug 3

This commit is contained in:
Andrew J. Hesford 2023-10-16 15:02:31 -04:00
parent 029fe12fcd
commit 66462c6e00
2 changed files with 25 additions and 1 deletions

View file

@ -0,0 +1,24 @@
From 2784eb2c1515f1cdb1554d049d48b3bff0f42085 Mon Sep 17 00:00:00 2001
From: Joe Esposito <joe@joeyespo.com>
Date: Wed, 11 Oct 2023 16:34:56 -0400
Subject: [PATCH] Support Werkzeug 3 by using a default encoding of UTF-8
This fixes the removal of `charset` attribute of requests from https://github.com/pallets/werkzeug/issues/2602
introduced by Werkzeug 2.3.0 (https://werkzeug.palletsprojects.com/en/3.0.x/changes/#version-2-3-0)
---
grip/app.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grip/app.py b/grip/app.py
index f963e9d..16cd5f4 100644
--- a/grip/app.py
+++ b/grip/app.py
@@ -397,7 +397,7 @@ def render(self, route=None):
route = '/'
with self.test_client() as c:
response = c.get(route, follow_redirects=True)
- encoding = response.charset
+ encoding = getattr(response, 'charset', 'utf-8')
return response.data.decode(encoding)
def run(self, host=None, port=None, debug=None, use_reloader=None,

View file

@ -1,7 +1,7 @@
# Template file for 'grip'
pkgname=grip
version=4.6.1
revision=3
revision=4
build_style=python3-module
hostmakedepends="python3-setuptools"
depends="python3-docopt python3-Flask python3-Markdown python3-path-and-address