Index | Thread | Search

From:
Stefan Hagen <sh+openbsd-ports@codevoid.de>
Subject:
[fix www/tuir] unbreak after python update
To:
ports@openbsd.org
Date:
Sat, 28 Dec 2024 17:47:12 +0100

Download raw body.

Thread
Hi,

The readfp() method of pythons ConfigParser Class has been deprecated
in Python 3.2 and got removed in Python 3.12. The replacing method is
read_file().

I'm not going to bother upstream. They dropped the ball after reddit
changed their API terms (last commit 4 years ago).

However, tuir still works perfectly fine when you create your own "app"
on reddit and configure tuir to use the app secret / token.

OK?

Best regards,
Stefan

Index: www/tuir/Makefile
===================================================================
RCS file: /cvs/ports/www/tuir/Makefile,v
diff -u -p -r1.12 Makefile
--- www/tuir/Makefile	21 Dec 2024 11:39:15 -0000	1.12
+++ www/tuir/Makefile	28 Dec 2024 16:32:05 -0000
@@ -3,7 +3,7 @@ COMMENT =		terminal UI for Reddit
 MODPY_DISTV =	1.29.0
 
 DISTNAME =		tuir-${MODPY_DISTV}
-REVISION =		7
+REVISION =		8
 
 CATEGORIES =		www
 
Index: www/tuir/patches/patch-tuir_config_py
===================================================================
RCS file: www/tuir/patches/patch-tuir_config_py
diff -N www/tuir/patches/patch-tuir_config_py
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ www/tuir/patches/patch-tuir_config_py	28 Dec 2024 16:32:05 -0000
@@ -0,0 +1,12 @@
+Index: tuir/config.py
+--- tuir/config.py.orig
++++ tuir/config.py
+@@ -131,7 +131,7 @@ class Config(object):
+         config = configparser.RawConfigParser()
+         if os.path.exists(filename):
+             with codecs.open(filename, encoding='utf-8') as fp:
+-                config.readfp(fp)
++                config.read_file(fp)
+ 
+         return cls._parse_tuir_file(config)
+ 
Index: www/tuir/patches/patch-tuir_theme_py
===================================================================
RCS file: www/tuir/patches/patch-tuir_theme_py
diff -N www/tuir/patches/patch-tuir_theme_py
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ www/tuir/patches/patch-tuir_theme_py	28 Dec 2024 16:32:05 -0000
@@ -0,0 +1,12 @@
+Index: tuir/theme.py
+--- tuir/theme.py.orig
++++ tuir/theme.py
+@@ -399,7 +399,7 @@ class Theme(object):
+             config = configparser.ConfigParser()
+             config.optionxform = six.text_type  # Preserve case
+             with codecs.open(filename, encoding='utf-8') as fp:
+-                config.readfp(fp)
++                config.read_file(fp)
+         except configparser.ParsingError as e:
+             raise ConfigError(e.message)
+