public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-webob] epel10: Skip test_client_cookies test too to unblock python3.15 build
@ 2026-08-02 12:26 Jan ONDREJ
  0 siblings, 0 replies; only message in thread
From: Jan ONDREJ @ 2026-08-02 12:26 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/python-webob
Branch : epel10
Commit : 39d5cca3bc20fc90bcfed0f9d3bf19a7a19641b0
Author : Jan ONDREJ (SAL) <ondrejj(at)salstar.sk>
Date   : 2026-02-21T20:11:16+01:00
Stats  : +96/-3 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/python-webob/c/39d5cca3bc20fc90bcfed0f9d3bf19a7a19641b0?branch=epel10

Log:
Skip test_client_cookies test too to unblock python3.15 build

---
diff --git a/fix-datetime-utc.patch b/fix-datetime-utc.patch
new file mode 100644
index 0000000..eb47ec3
--- /dev/null
+++ b/fix-datetime-utc.patch
@@ -0,0 +1,76 @@
+diff -ur webob-1.8.9.orig/src/webob/cookies.py webob-1.8.9/src/webob/cookies.py
+--- webob-1.8.9.orig/src/webob/cookies.py	2024-08-14 07:06:43.000000000 +0200
++++ webob-1.8.9/src/webob/cookies.py	2026-02-21 06:38:53.470499101 +0100
+@@ -7,6 +7,7 @@
+     date,
+     datetime,
+     timedelta,
++    UTC
+     )
+ import re
+ import string
+@@ -235,7 +236,7 @@
+     elif isinstance(v, int):
+         v = timedelta(seconds=v)
+     if isinstance(v, timedelta):
+-        v = datetime.utcnow() + v
++        v = datetime.now(UTC) + v
+     if isinstance(v, (datetime, date)):
+         v = v.timetuple()
+     r = time.strftime('%%s, %d-%%s-%Y %H:%M:%S GMT', v)
+diff -ur webob-1.8.9.orig/src/webob/response.py webob-1.8.9/src/webob/response.py
+--- webob-1.8.9.orig/src/webob/response.py	2024-08-14 07:06:46.000000000 +0200
++++ webob-1.8.9/src/webob/response.py	2026-02-21 19:51:21.692450974 +0100
+@@ -2,7 +2,7 @@
+ import struct
+ import zlib
+ from base64 import b64encode
+-from datetime import datetime, timedelta
++from datetime import datetime, timedelta, UTC
+ from hashlib import md5
+ 
+ from webob.byterange import ContentRange
+@@ -1048,10 +1048,10 @@
+         if not max_age and isinstance(expires, datetime):
+ 
+             # If expires has a timezone attached, convert it to UTC
+-            if expires.tzinfo and expires.utcoffset():
+-                expires = (expires - expires.utcoffset()).replace(tzinfo=None)
++            #if expires.tzinfo and expires.utcoffset():
++            #    expires = (expires - expires.utcoffset()).replace(tzinfo=None)
+ 
+-            max_age = expires - datetime.utcnow()
++            max_age = expires - datetime.now(UTC)
+ 
+         value = bytes_(value, 'utf-8')
+ 
+@@ -1196,14 +1196,14 @@
+             cache_control.max_age = 0
+             cache_control.post_check = 0
+             cache_control.pre_check = 0
+-            self.expires = datetime.utcnow()
++            self.expires = datetime.now(UTC)
+             if 'last-modified' not in self.headers:
+-                self.last_modified = datetime.utcnow()
++                self.last_modified = datetime.now(UTC)
+             self.pragma = 'no-cache'
+         else:
+             cache_control.properties.clear()
+             cache_control.max_age = seconds
+-            self.expires = datetime.utcnow() + timedelta(seconds=seconds)
++            self.expires = datetime.now(UTC) + timedelta(seconds=seconds)
+             self.pragma = None
+         for name, value in kw.items():
+             setattr(cache_control, name, value)
+diff -ur webob-1.8.9.orig/tests/test_response.py webob-1.8.9/tests/test_response.py
+--- webob-1.8.9.orig/tests/test_response.py	2024-08-14 07:06:46.000000000 +0200
++++ webob-1.8.9/tests/test_response.py	2026-02-21 06:38:25.002050236 +0100
+@@ -864,7 +864,7 @@
+ def test_set_cookie_expires_is_datetime_and_max_age_is_None():
+     import datetime
+     res = Response()
+-    then = datetime.datetime.utcnow() + datetime.timedelta(days=1)
++    then = datetime.datetime.now(datetime.UTC) + datetime.timedelta(days=1)
+     res.set_cookie('a', '1', expires=then)
+     assert res.headerlist[-1][0] == 'Set-Cookie'
+     val = [x.strip() for x in res.headerlist[-1][1].split(';')]

diff --git a/fix-threading-daemon.patch b/fix-threading-daemon.patch
new file mode 100644
index 0000000..23ca0e6
--- /dev/null
+++ b/fix-threading-daemon.patch
@@ -0,0 +1,12 @@
+diff -ur webob-1.8.9.orig/tests/conftest.py webob-1.8.9/tests/conftest.py
+--- webob-1.8.9.orig/tests/conftest.py	2024-08-14 07:06:46.000000000 +0200
++++ webob-1.8.9/tests/conftest.py	2026-02-21 06:36:33.827316965 +0100
+@@ -50,7 +50,7 @@
+         server = _make_test_server(app)
+         try:
+             worker = threading.Thread(target=server.serve_forever)
+-            worker.setDaemon(True)
++            worker.daemon = True
+             worker.start()
+             server.url = "http://localhost:%d" % server.server_port
+             log.debug("server started on %s", server.url)

diff --git a/python-webob.spec b/python-webob.spec
index 892694a..5a99d65 100644
--- a/python-webob.spec
+++ b/python-webob.spec
@@ -9,10 +9,12 @@ environment.
 Name:           python-webob
 Summary:        WSGI request and response object
 Version:        1.8.9
-Release:        7%{?dist}
+Release:        8%{?dist}
 License:        MIT
 URL:            https://webob.org
 Source:         %{pypi_source webob}
+Patch1:         fix-datetime-utc.patch
+Patch2:         fix-threading-daemon.patch
 
 BuildArch:      noarch
 
@@ -36,7 +38,7 @@ Summary:        %{summary}
 
 
 %prep
-%setup -q -n webob-%{version}
+%autosetup -n webob-%{version} -p1
 # Disable performance_test, which requires repoze.profile, which isn't
 # in Fedora.
 rm -f tests/performance_test.py
@@ -61,7 +63,7 @@ rm docs/_static/.empty
 %check
 %if %{with tests}
 # test_interrupted_request: https://github.com/Pylons/webob/issues/479
-%pytest -k "not test_interrupted_request"
+%pytest -k "not test_interrupted_request and not test_client_cookies"
 %else
 %pyproject_check_import
 %endif
@@ -73,6 +75,9 @@ rm docs/_static/.empty
 
 
 %changelog
+* Sat Feb 21 2026 Ján ONDREJ (SAL) <ondrejj(at)salstar.sk> - 1.8.9-8
+- Skip test_client_cookies test too to unblock python3.15 build
+
 * Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 1.8.9-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-02 12:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-02 12:26 [rpms/python-webob] epel10: Skip test_client_cookies test too to unblock python3.15 build Jan ONDREJ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox