From: Vinfall <Vinfall@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] buku: fix cgi deprecation warning for python3>=3.11
Date: Thu, 17 Nov 2022 03:45:56 +0100 [thread overview]
Message-ID: <20221117024556.ifkPUUm31RVgOIANPHxiSg_ITFpqk_gd-PksXPf7PmY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40555@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 827 bytes --]
There is an updated pull request by Vinfall against master on the void-packages repository
https://github.com/Vinfall/void-packages master
https://github.com/void-linux/void-packages/pull/40555
buku: fix cgi deprecation warning for python3>=3.11
#### Changes
Followup of #40551.
Add the necessary patch to remove the DeprecationWarning `'cgi' is deprecated and slated for removal in Python 3.13` in buku caused by Python3 version update (3.11 as of writing).
#### Testing the changes
- I tested the changes in this PR: **YES**
#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)
- I built this PR locally for these architectures:
- armv6l
- `xlint` also reports no error.
A patch file from https://github.com/void-linux/void-packages/pull/40555.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-master-40555.patch --]
[-- Type: text/x-diff, Size: 2418 bytes --]
From 902daad122eab3a073324348a32fd376b1dbf43e Mon Sep 17 00:00:00 2001
From: Vinfall <vinfall@users.noreply.github.com>
Date: Wed, 16 Nov 2022 18:26:55 +0800
Subject: [PATCH] buku: fix cgi deprecation warning for python3>=3.11
---
srcpkgs/buku/patches/remove-cgi-warning.patch | 37 +++++++++++++++++++
srcpkgs/buku/template | 2 +-
2 files changed, 38 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/buku/patches/remove-cgi-warning.patch
diff --git a/srcpkgs/buku/patches/remove-cgi-warning.patch b/srcpkgs/buku/patches/remove-cgi-warning.patch
new file mode 100644
index 000000000000..2075e2486431
--- /dev/null
+++ b/srcpkgs/buku/patches/remove-cgi-warning.patch
@@ -0,0 +1,37 @@
+--- a/buku
++++ b/buku
+@@ -19,10 +19,10 @@
+
+ import argparse
+ import calendar
+-import cgi
+ import codecs
+ import collections
+ import contextlib
++import email.message
+ import json
+ import locale
+ import logging
+@@ -3811,15 +3811,17 @@
+ if soup.meta and soup.meta.get('charset') is not None:
+ charset = soup.meta.get('charset')
+ elif 'content-type' in resp.headers:
+- _, params = cgi.parse_header(resp.headers['content-type'])
+- if params.get('charset') is not None:
+- charset = params.get('charset')
++ m = email.message.Message()
++ m['content-type'] = resp.headers['content-type']
++ if m.get_param('charset') is not None:
++ charset = m.get_param('charset')
+
+ if not charset and soup:
+ meta_tag = soup.find('meta', attrs={'http-equiv': 'Content-Type'})
+ if meta_tag:
+- _, params = cgi.parse_header(meta_tag.attrs['content'])
+- charset = params.get('charset', charset)
++ m = email.message.Message()
++ m['content'] = meta_tag.attrs['content']
++ charset = m.get_param('charset', charset)
+
+ if charset:
+ LOGDBG('charset: %s', charset)
diff --git a/srcpkgs/buku/template b/srcpkgs/buku/template
index d23f9addf74f..2bd38b49f1df 100644
--- a/srcpkgs/buku/template
+++ b/srcpkgs/buku/template
@@ -1,7 +1,7 @@
# Template file for 'buku'
pkgname=buku
version=4.7
-revision=1
+revision=2
depends="python3-urllib3 python3-BeautifulSoup4 python3-cryptography
python3-html5lib"
short_desc="Cmdline bookmark management utility"
next prev parent reply other threads:[~2022-11-17 2:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 10:33 [PR PATCH] " Vinfall
2022-11-16 10:39 ` [PR REVIEW] " paper42
2022-11-16 14:16 ` Vinfall
2022-11-17 2:45 ` Vinfall [this message]
2022-11-17 14:07 ` [PR PATCH] [Updated] " Vinfall
2022-11-17 14:08 ` Vinfall
2022-11-18 6:44 ` [PR REVIEW] " classabbyamp
2022-11-18 6:46 ` classabbyamp
2022-11-18 6:46 ` classabbyamp
2022-12-03 1:22 ` Vinfall
2022-12-03 2:03 ` classabbyamp
2022-12-03 7:35 ` [PR PATCH] [Updated] " Vinfall
2022-12-03 7:36 ` Vinfall
2022-12-03 7:36 ` [PR REVIEW] " Vinfall
2022-12-04 2:12 ` [PR PATCH] [Updated] " Vinfall
2022-12-04 2:21 ` Vinfall
2022-12-04 2:27 ` Vinfall
2022-12-04 3:34 ` [PR PATCH] [Merged]: " classabbyamp
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221117024556.ifkPUUm31RVgOIANPHxiSg_ITFpqk_gd-PksXPf7PmY@z \
--to=vinfall@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).