Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-FormEncode for 
openSUSE:Factory checked in at 2024-09-10 21:12:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-FormEncode (Old)
 and      /work/SRC/openSUSE:Factory/.python-FormEncode.new.17570 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-FormEncode"

Tue Sep 10 21:12:44 2024 rev:21 rq:1199779 version:2.1.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-FormEncode/python-FormEncode.changes      
2024-04-17 14:45:08.185529755 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-FormEncode.new.17570/python-FormEncode.changes
   2024-09-10 21:12:55.437264117 +0200
@@ -1,0 +2,7 @@
+Tue Sep 10 04:11:22 UTC 2024 - Steve Kowalik <steven.kowa...@suse.com>
+
+- Add patch do-not-always-use-cgi-module.patch:
+  * Support Python 3.13 by making use of cgi optional.
+- Switch to autosetup macro.
+
+-------------------------------------------------------------------

New:
----
  do-not-always-use-cgi-module.patch

BETA DEBUG BEGIN:
  New:
- Add patch do-not-always-use-cgi-module.patch:
  * Support Python 3.13 by making use of cgi optional.
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-FormEncode.spec ++++++
--- /var/tmp/diff_new_pack.EXYnoM/_old  2024-09-10 21:12:55.893283117 +0200
+++ /var/tmp/diff_new_pack.EXYnoM/_new  2024-09-10 21:12:55.897283283 +0200
@@ -22,9 +22,11 @@
 Release:        0
 Summary:        HTML form validation, generation, and conversion package
 License:        Python-2.0
-Group:          Development/Languages/Python
 URL:            https://formencode.org
 Source:         
https://files.pythonhosted.org/packages/source/F/FormEncode/FormEncode-%{version}.tar.gz
+# PATCH-FIX-UPSTREAM gh#formencode/formencode#176
+Patch0:         do-not-always-use-cgi-module.patch
+BuildRequires:  %{python_module base >= 3.7}
 BuildRequires:  %{python_module dnspython}
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module pycountry}
@@ -43,7 +45,7 @@
 for filling and generating forms.
 
 %prep
-%setup -q -n FormEncode-%{version}
+%autosetup -p1 -n FormEncode-%{version}
 
 %build
 %pyproject_wheel
@@ -71,5 +73,5 @@
 %license LICENSE.txt
 %doc README.rst
 %{python_sitelib}/formencode
-%{python_sitelib}/FormEncode-%{version}*-info
+%{python_sitelib}/FormEncode-%{version}.dist-info
 

++++++ do-not-always-use-cgi-module.patch ++++++
>From 77053ce944c11b1bae67cee387275e9f36d8d049 Mon Sep 17 00:00:00 2001
From: Oleg Broytman <p...@phdru.name>
Date: Fri, 10 Nov 2023 18:17:15 +0300
Subject: [PATCH] Protect `import cgi`

Module `cgi` was declared obsolete in Python 3.11
and will be removed in 3.13.

Fixes: #175.
---
 src/formencode/validators.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/formencode/validators.py b/src/formencode/validators.py
index f2011b4..6f272b7 100644
--- a/src/formencode/validators.py
+++ b/src/formencode/validators.py
@@ -5,7 +5,10 @@
 Validator/Converters for use with FormEncode.
 """
 
-import cgi
+try:
+    import cgi
+except ImportError:  # Python >= 3.13
+    cgi = None
 import re
 import warnings
 from encodings import idna
@@ -1772,7 +1775,7 @@ class FieldStorageUploadConverter(FancyValidator):
     no upload was given).
     """
     def _convert_to_python(self, value, state=None):
-        if isinstance(value, cgi.FieldStorage):
+        if cgi and isinstance(value, cgi.FieldStorage):
             if getattr(value, 'filename', None):
                 return value
             raise Invalid('invalid', value, state)
@@ -1780,7 +1783,7 @@ def _convert_to_python(self, value, state=None):
             return value
 
     def is_empty(self, value):
-        if isinstance(value, cgi.FieldStorage):
+        if cgi and isinstance(value, cgi.FieldStorage):
             return not bool(getattr(value, 'filename', None))
         return FancyValidator.is_empty(self, value)
 
@@ -1825,7 +1828,7 @@ def _convert_to_python(self, value, state):
         upload = value.get(self.upload_key)
         static = value.get(self.static_key, '').strip()
         filename = content = None
-        if isinstance(upload, cgi.FieldStorage):
+        if cgi and isinstance(upload, cgi.FieldStorage):
             filename = upload.filename
             content = upload.value
         elif isinstance(upload, str) and upload:

Reply via email to