Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] buku: fix cgi deprecation warning for python3>=3.11
@ 2022-11-16 10:33 Vinfall
  2022-11-16 10:39 ` [PR REVIEW] " paper42
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Vinfall @ 2022-11-16 10:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 822 bytes --]

There is a new 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"

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-12-04  3:34 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16 10:33 [PR PATCH] buku: fix cgi deprecation warning for python3>=3.11 Vinfall
2022-11-16 10:39 ` [PR REVIEW] " paper42
2022-11-16 14:16 ` Vinfall
2022-11-17  2:45 ` [PR PATCH] [Updated] " Vinfall
2022-11-17 14:07 ` 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

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).