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: NEW
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:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-11-20 15:01 UTC by Tomáš Hrnčiar
Modified: 2021-02-09 16:24 UTC (History)
5 users (show)

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


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.


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