Package: src:python-glancepoint
Version: 1:4.11.0-3
User: [email protected]
Usertags: python3.15
Tags: patch, ftbfs, forky, sid

Hi!

While rebuilding the python related packages against the Python 3.15rc1
version we found that python-glancepoint fails to build from source [1].
The issue happens because it fails to match ValueError message with the
expected text. Python 3.15 updated the text in some of the exceptions to
make them clearer, this affected the tests in python-glanceclient as
they expect some specific wordings. I prepared a patch so that the test
now expects a match in a regular expression compatible with both
wordings.

I applied the fix in the sandbox [2] to be able to build the packages
that depend on python-glancepoint, please consider applying the patch to
support the upcoming 3.15 version.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4583032/
[2]: https://debusine.debian.net/debian/r-python-python3.15/

--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
Description: Support Python 3.15 hashlib error message change
 In Python 3.15, hashlib raises ValueError with 'unsupported hash algorithm'
 instead of 'unsupported hash type'.
Author: Maximiliano Curia <[email protected]>
Forwarded: no

Index: python-glanceclient/glanceclient/tests/unit/v2/test_images.py
===================================================================
--- python-glanceclient.orig/glanceclient/tests/unit/v2/test_images.py
+++ python-glanceclient/glanceclient/tests/unit/v2/test_images.py
@@ -1188,8 +1188,10 @@ class TestController(testtools.TestCase)
             body = self.controller.data('badalgo-db27-11e1-a1eb-080027cbe205')
             self.fail('bad os_hash_algo did not raise an error.')
         except ValueError as e:
-            msg = 'unsupported hash type not_an_algo'
-            self.assertIn(msg, str(e))
+            self.assertThat(
+                str(e),
+                testtools.matchers.MatchesRegex(
+                    r'unsupported hash (type|algorithm) not_an_algo'))
 
     def test_data_with_checksum(self):
         for prefix in ['headeronly', 'chkonly', 'multihash']:
Index: python-glanceclient/glanceclient/v2/images.py
===================================================================
--- python-glanceclient.orig/glanceclient/v2/images.py
+++ python-glanceclient/glanceclient/v2/images.py
@@ -268,7 +268,8 @@ class Controller(object):
                                                     meta_hash_value)
                 check_md5sum = False
             except ValueError as ve:
-                if (str(ve).startswith('unsupported hash type') and
+                if (str(ve).startswith(('unsupported hash type',
+                                        'unsupported hash algorithm')) and
                         allow_md5_fallback):
                     check_md5sum = True
                 else:

Reply via email to