sqlalchemy: FTBFS against python 3.15rc1

Maximiliano Curia <[email protected]>
Newsgroups gmane.linux.debian.devel.python
Message-ID <[email protected]>
Package: src:sqlalchemy
Version: 2.0.48+ds1-1
User: [email protected]
Usertags: python3.15
Tags: patch

Hi!

While rebuilding the python related packages against the Python 3.15rc1
version we found that sqlalchemy fails to build from source [2]. The fix is
already release upstream with the version 2.0.50 (438f1f7 Adjust
TypeError message to Python 3.15), and in the release 2.0.52, version
3.15 was added as a officially supported.

I applied the upstream fix in the sandbox [1] to be able to build the
packages that depend on sqlalchemy, please consider either adding the
upstream patch or updating sqlalchemy to newer version so it support the
upcoming 3.15 version.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/
[2]: https://debusine.debian.net/debian/r-python-python3.15/work-request/1013699/
-- 
"If you are in a hole, stop digging." -- The First Rule of Excavation
Saludos /\/\ /\ >< `/
sqlalchemy_2.0.48+ds1-1.1.debdiff (text/plain, 4.2 KB)
diff -Nru sqlalchemy-2.0.48+ds1/debian/changelog sqlalchemy-2.0.48+ds1/debian/changelog
--- sqlalchemy-2.0.48+ds1/debian/changelog	2026-03-26 17:21:23.000000000 +0100
+++ sqlalchemy-2.0.48+ds1/debian/changelog	2026-08-18 10:45:05.000000000 +0200
@@ -1,3 +1,11 @@
+sqlalchemy (2.0.48+ds1-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Backport upstream patch: adjust-typeerror-message-to-py315.patch
+    Fix build against python 3.15
+
+ -- Maximiliano Curia <[email protected]>  Tue, 18 Aug 2026 10:45:05 +0200
+
 sqlalchemy (2.0.48+ds1-1) unstable; urgency=medium
 
   * New upstream release
diff -Nru sqlalchemy-2.0.48+ds1/debian/patches/adjust-typeerror-message-to-py315.patch sqlalchemy-2.0.48+ds1/debian/patches/adjust-typeerror-message-to-py315.patch
--- sqlalchemy-2.0.48+ds1/debian/patches/adjust-typeerror-message-to-py315.patch	1970-01-01 01:00:00.000000000 +0100
+++ sqlalchemy-2.0.48+ds1/debian/patches/adjust-typeerror-message-to-py315.patch	2026-08-18 10:44:41.000000000 +0200
@@ -0,0 +1,68 @@
+commit 438f1f78492aae8577d97874d125af212d3da049
+Author: Karolina Surma <[email protected]>
+Date:   Tue May 19 10:20:38 2026 -0400
+
+    Adjust TypeError message to Python 3.15
+    
+    <!-- Provide a general summary of your proposed changes in the Title field above -->
+    
+    ### Description
+    The `.fromisoformat()` error message tested in `test_no_string()` changed in Python 3.15, this fixes the test.
+    
+    See #13308 for the `rel_2_0` branch.
+    
+    ### Checklist
+    <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)
+    
+    -->
+    
+    This pull request is:
+    
+    - [ ] A documentation / typographical / small typing error fix
+            - Good to go, no issue or tests are needed
+    - [x] A short code fix (in a test, therefore I didn’t create an issue)
+            - please include the issue number, and create an issue if none exists, which
+              must include a complete example of the issue.  one line code fixes without an
+              issue and demonstration will not be accepted.
+            - Please include: `Fixes: #<issue number>` in the commit message
+            - please include tests.   one line code fixes without tests will not be accepted.
+    - [ ] A new feature implementation
+            - please include the issue number, and create an issue if none exists, which must
+              include a complete example of how the feature would look.
+            - Please include: `Fixes: #<issue number>` in the commit message
+            - please include tests.
+    
+    **Have a nice day!**
+    
+    Closes: #13307
+    Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/13307
+    Pull-request-sha: 90bc13fc416ea45ba5429d5f8ecffc24b108c1b1
+    
+    Change-Id: I461d71b0fad18fa4f108102bb1c22c0e980fc70e
+    (cherry picked from commit f07ad99839105f254df4e640ab851bcc6910168c)
+
+diff --git a/test/engine/test_processors.py b/test/engine/test_processors.py
+index 4f06f772a..e2bb50a2c 100644
+--- a/test/engine/test_processors.py
++++ b/test/engine/test_processors.py
+@@ -73,13 +73,13 @@ class _DateProcessorTest(fixtures.TestBase):
+ 
+         eq_(self.module.str_to_date("2022-04-03"), datetime.date(2022, 4, 3))
+ 
+-    def test_date_no_string(self):
+-        assert_raises_message(
+-            TypeError,
+-            "fromisoformat: argument must be str",
+-            self.module.str_to_date,
+-            2012,
+-        )
++    @combinations("str_to_datetime", "str_to_time", "str_to_date")
++    def test_no_string(self, meth):
++        with expect_raises_message(
++            TypeError, r"fromisoformat.* argument must be str"
++        ):
++            fn = getattr(self.module, meth)
++            fn(2012)
+ 
+     def test_datetime_no_string_custom_reg(self):
+         assert_raises_message(
diff -Nru sqlalchemy-2.0.48+ds1/debian/patches/series sqlalchemy-2.0.48+ds1/debian/patches/series
--- sqlalchemy-2.0.48+ds1/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ sqlalchemy-2.0.48+ds1/debian/patches/series	2026-08-18 10:44:41.000000000 +0200
@@ -0,0 +1 @@
+adjust-typeerror-message-to-py315.patch
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE+JIdOnQEyG4RNSIVxxl2mbKbIyoFAmqEg+wACgkQxxl2mbKb
Iyp91w/+I24fl5WfcyHfXFJ9piHrYHyrdNusEYSs1xj4Dg1TFVTk8EkquST5iBZo
uwx/9k+JmfBT+BZ7V+WcoIE1invZ3AGA3Hx8h6Ii++CqKRRkr7bRwNFwqkj7pEgt
lEthI3wTCQ/taRbWFXFxyReMIn1xX9XYiiXEFj7lVvOXBX+TcwXaXtNr7eNiwFdq
KTeWemO1ehPHM5venquj5AfWkbzI62+A1uDGF1gKNRZuqZIOLU4RF4L+yn64DiQM
P5VDPhI5RzA1hcqS1ytaMdqBIFeJkxbuhoW4OtD4w0ShTDdour2IrT/GYPlYcnCm
BA54+B486F7AlnqEGarKQL01XfEvYgrLagqVVsUqeOCpDY5CEmeHjOUal2rO5OCF
yrMciWAUNop+dqhVLcS508YVOVd0un4eSpAm9dIXWDov5kC5mbK3Mz3Rln0VLv+F
8Ek91QbwPQmNJGGTPTwDvZHmATdVBQMZn+dsnG8sIxE+362wiL3DjQGBxqtoWSgp
BsPHboRl7rqWgzClNVSOVC0ErGw+UBHxz4TkQWUGhLMx4MtChBe/wzmNiRBxDolD
4+6HTSwxrpQjmb+BBD/VEihFK7rDnNWJLPEjx0YmMNLjLycZ0UhV0NWfVHqyxIiZ
UZ2iP9DXkNf69DDeQhmq5QOoaGOnrZas6CjmNYItGzUtNGmuZXQ=
=iMu3
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.