Bug 2093940

Summary: python-mechanize fails to build with Python 3.11: AssertionError: assert c.name == names[i]
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-mechanizeAssignee: Mohan Boddu <mboddu>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: awilliam, kevin, lewk, mboddu, mhroncok, thrnciar
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python3-mechanize-0.4.8-4.fc37 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-07-16 06:27:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2016048, 2098679    

Description Tomáš Hrnčiar 2022-06-06 12:22:12 UTC
python-mechanize fails to build with Python 3.11.0b3.

======================================================================
FAIL: test_Cookie_iterator (test.test_cookies.CookieTests.test_Cookie_iterator)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mechanize-0.4.8/test/test_cookies.py", line 1032, in test_Cookie_iterator
    assert c.name == names[i]
    ^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError

----------------------------------------------------------------------
Ran 306 tests in 5.850s

FAILED (failures=1)

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

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/04497053-python-mechanize/

For all our attempts to build python-mechanize with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/python-mechanize/

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.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
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 Miro Hrončok 2022-06-20 10:18:30 UTC
*** Bug 2099002 has been marked as a duplicate of this bug. ***

Comment 2 Adam Williamson 2022-06-24 00:31:20 UTC
https://koji.fedoraproject.org/koji/taskinfo?taskID=88668272 fixes this, with some patches backported from upstream main.

Comment 3 Miro Hrončok 2022-07-16 06:14:34 UTC
(In reply to Adam Williamson from comment #2)
> https://koji.fedoraproject.org/koji/taskinfo?taskID=88668272 fixes this,
> with some patches backported from upstream main.

But the module is not there:

<mock-chroot> sh-5.1$ python3
Python 3.11.0b4 (main, Jul 11 2022, 00:00:00) [GCC 12.1.1 20220628 (Red Hat 12.1.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mechanize
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'mechanize'


<mock-chroot> sh-5.1$ rpm -ql python3-mechanize
/usr/lib/python3.11/site-packages/mechanize-0.4.8-py3.11.egg-info
/usr/lib/python3.11/site-packages/mechanize-0.4.8-py3.11.egg-info/PKG-INFO
/usr/lib/python3.11/site-packages/mechanize-0.4.8-py3.11.egg-info/SOURCES.txt
/usr/lib/python3.11/site-packages/mechanize-0.4.8-py3.11.egg-info/dependency_links.txt
/usr/lib/python3.11/site-packages/mechanize-0.4.8-py3.11.egg-info/requires.txt
/usr/lib/python3.11/site-packages/mechanize-0.4.8-py3.11.egg-info/top_level.txt
/usr/lib/python3.11/site-packages/mechanize-0.4.8-py3.11.egg-info/zip-safe
/usr/share/doc/python3-mechanize
/usr/share/doc/python3-mechanize/COPYRIGHT
/usr/share/doc/python3-mechanize/ChangeLog
/usr/share/doc/python3-mechanize/README.rst
/usr/share/licenses/python3-mechanize
/usr/share/licenses/python3-mechanize/LICENSE