Bug 1899997 - python-mechanize fails to build with Python 3.10: http.cookiejar.LoadError: '/tmp/tmp7x4y1z7e' does not look like a Netscape format cookies file
Summary: python-mechanize fails to build with Python 3.10: http.cookiejar.LoadError: '...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-mechanize
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Mohan Boddu
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1969027 (view as bug list)
Depends On:
Blocks: PYTHON3.10 F35FTBFS F35FailsToInstall 1968783
TreeView+ depends on / blocked
 
Reported: 2020-11-20 15:01 UTC by Tomáš Hrnčiar
Modified: 2021-06-13 11:45 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-13 11:45:39 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-11-20 15:01:47 UTC
python-mechanize fails to build with Python 3.10.0a2.

======================================================================
ERROR: test_mozilla_cookiejar (test.test_cookies.CookieJarPersistenceTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mechanize-0.4.5/test/test_cookies.py", line 1266, in test_mozilla_cookiejar
    new_c = save_and_restore(c, True)
  File "/builddir/build/BUILD/mechanize-0.4.5/test/test_cookies.py", line 1258, in save_and_restore
    new_c.load(ignore_discard=ignore_discard)
  File "/usr/lib64/python3.10/http/cookiejar.py", line 1807, in load
    self._really_load(f, filename, ignore_discard, ignore_expires)
  File "/builddir/build/BUILD/mechanize-0.4.5/mechanize/_clientcookie.py", line 199, in _really_load
    raise LoadError(
http.cookiejar.LoadError: '/tmp/tmp7x4y1z7e' does not look like a Netscape format cookies file

======================================================================
ERROR: test_mozilla_cookiejar_embedded_tab (test.test_cookies.CookieJarPersistenceTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mechanize-0.4.5/test/test_cookies.py", line 1285, in test_mozilla_cookiejar_embedded_tab
    fh.write(MozillaCookieJar.header + "\n" +
AttributeError: type object 'MozillaCookieJar' has no attribute 'header'

======================================================================
ERROR: test_mozilla_cookiejar_initial_dot_violation (test.test_cookies.CookieJarPersistenceTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mechanize-0.4.5/test/test_cookies.py", line 1306, in test_mozilla_cookiejar_initial_dot_violation
    fh.write(MozillaCookieJar.header + "\n" +
AttributeError: type object 'MozillaCookieJar' has no attribute 'header'

======================================================================
ERROR: test_missing_name (test.test_cookies.CookieTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mechanize-0.4.5/test/test_cookies.py", line 342, in test_missing_name
    c.revert(ignore_expires=True, ignore_discard=True)
  File "/usr/lib64/python3.10/http/cookiejar.py", line 1827, in revert
    self.load(filename, ignore_discard, ignore_expires)
  File "/usr/lib64/python3.10/http/cookiejar.py", line 1807, in load
    self._really_load(f, filename, ignore_discard, ignore_expires)
  File "/builddir/build/BUILD/mechanize-0.4.5/mechanize/_clientcookie.py", line 199, in _really_load
    raise LoadError(
http.cookiejar.LoadError: '/tmp/tmp7opv565o' does not look like a Netscape format cookies file

======================================================================
ERROR: test_mozilla_cookiejar (test.test_functional.CookieJarTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mechanize-0.4.5/test/test_functional.py", line 684, in test_mozilla_cookiejar
    self._test_cookiejar(make_cookiejar, commit)
  File "/builddir/build/BUILD/mechanize-0.4.5/test/test_functional.py", line 664, in _test_cookiejar
    cookiejar = make_cookiejar()
  File "/builddir/build/BUILD/mechanize-0.4.5/test/test_functional.py", line 676, in make_cookiejar
    cj.revert()
  File "/usr/lib64/python3.10/http/cookiejar.py", line 1827, in revert
    self.load(filename, ignore_discard, ignore_expires)
  File "/usr/lib64/python3.10/http/cookiejar.py", line 1807, in load
    self._really_load(f, filename, ignore_discard, ignore_expires)
  File "/builddir/build/BUILD/mechanize-0.4.5/mechanize/_clientcookie.py", line 199, in _really_load
    raise LoadError(
http.cookiejar.LoadError: '/tmp/tmp-TempDirMaker-ztyxts3v/cookies.txt' does not look like a Netscape format cookies file

----------------------------------------------------------------------
Ran 304 tests in 6.257s

FAILED (errors=5)
sys:1: ResourceWarning: unclosed <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 46807)>
sys:1: ResourceWarning: unclosed <socket.socket fd=19, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 38751)>
sys:1: ResourceWarning: unclosed <socket.socket fd=7, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 46165)>

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

For all our attempts to build python-mechanize with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/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.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
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 Ben Cotton 2021-02-09 15:26:47 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 2 Miro Hrončok 2021-06-04 20:14:18 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.


The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.

Thanks.

See also https://fedoraproject.org/wiki/Changes/Python3.10

If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/

Comment 3 Miro Hrončok 2021-06-07 22:58:57 UTC
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.

Comment 4 Miro Hrončok 2021-06-08 11:28:02 UTC
*** Bug 1969027 has been marked as a duplicate of this bug. ***


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