Bug 2183186 - pygobject3 fails to build with Python 3.12: AssertionError: Regex pattern did not match.
Summary: pygobject3 fails to build with Python 3.12: AssertionError: Regex pattern did...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: pygobject3
Version: 39
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Colin Walters
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.12
TreeView+ depends on / blocked
 
Reported: 2023-03-30 14:16 UTC by Tomáš Hrnčiar
Modified: 2023-08-16 07:12 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)
possible patch/workaround (1.22 KB, application/mbox)
2023-03-30 14:16 UTC, Tomáš Hrnčiar
no flags Details

Description Tomáš Hrnčiar 2023-03-30 14:16:07 UTC
Created attachment 1954692 [details]
possible patch/workaround

pygobject3 fails to build with Python 3.12.0a6.

=================================== FAILURES ===================================
__________ TestGValue.test_gvalue_flat_array_in_item_marshal_failure ___________

self = <tests.test_gi.TestGValue testMethod=test_gvalue_flat_array_in_item_marshal_failure>

    def test_gvalue_flat_array_in_item_marshal_failure(self):
        # Tests the failure to marshal 2^256 to a GValue mid-way through the array marshaling.
        self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
                          [42, 2 ** 256, True])
    
        self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
                          [GLib.MAXINT + 1, "42", True])
        self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
                          [GLib.MININT - 1, "42", True])
    
        with pytest.raises(
                OverflowError,
                match='Item 0: %d not in range %d to %d' % (
                    GLib.MAXINT + 1, GLib.MININT, GLib.MAXINT)):
>           GIMarshallingTests.gvalue_flat_array([GLib.MAXINT + 1, "42", True])
E           OverflowError: 2147483648 not in range -2147483648 to 2147483647

../tests/test_gi.py:1580: OverflowError

During handling of the above exception, another exception occurred:

self = <tests.test_gi.TestGValue testMethod=test_gvalue_flat_array_in_item_marshal_failure>

    def test_gvalue_flat_array_in_item_marshal_failure(self):
        # Tests the failure to marshal 2^256 to a GValue mid-way through the array marshaling.
        self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
                          [42, 2 ** 256, True])
    
        self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
                          [GLib.MAXINT + 1, "42", True])
        self.assertRaises(OverflowError, GIMarshallingTests.gvalue_flat_array,
                          [GLib.MININT - 1, "42", True])
    
>       with pytest.raises(
                OverflowError,
                match='Item 0: %d not in range %d to %d' % (
                    GLib.MAXINT + 1, GLib.MININT, GLib.MAXINT)):
E                   AssertionError: Regex pattern did not match.
E                    Regex: 'Item 0: 2147483648 not in range -2147483648 to 2147483647'
E                    Input: '2147483648 not in range -2147483648 to 2147483647'

To workaround this, I'll remove "Item 0: " from regex and build it in COPR this way so the package builds. I could use some help in figuring out if it's a proper solution or if something else should be done. 

https://docs.python.org/3.12/whatsnew/3.12.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-rawhide-x86_64/05725952-pygobject3/

For all our attempts to build pygobject3 with Python 3.12, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/pygobject3/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.12:
https://copr.fedorainfracloud.org/coprs/g/python/python3.12/

Let us know here if you have any questions.

Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Fedora Release Engineering 2023-08-16 07:12:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.


Note You need to log in before you can comment on or make changes to this bug.