Bug 2026351 - python-gitdb fails to build with Python 3.11: AttributeError: 'TestGitDB' object has no attribute 'failUnlessRaises'
Summary: python-gitdb fails to build with Python 3.11: AttributeError: 'TestGitDB' obj...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-gitdb
Version: 36
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Carl George 🤠
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2021-11-24 12:33 UTC by Tomáš Hrnčiar
Modified: 2022-02-10 04:27 UTC (History)
8 users (show)

Fixed In Version: python-gitdb-4.0.9-2.fc37
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-02-10 04:27:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-11-24 12:33:31 UTC
python-gitdb fails to build with Python 3.11.0a2.

======================================================================
ERROR: test_reading (gitdb.test.db.test_git.TestGitDB)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/db/test_git.py", line 46, in test_reading
    self.failUnlessRaises(BadObject, gdb.partial_to_complete_sha_hex, "0000")
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestGitDB' object has no attribute 'failUnlessRaises'
-------------------- >> begin captured logging << --------------------
root: INFO: You can set the GITDB_TEST_GIT_REPO_BASE environment variable to a .git repository of your choice - defaulting to the gitdb repository
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_writing (gitdb.test.db.test_git.TestGitDB)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/lib.py", line 86, in wrapper
    return func(self, path)
           ^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/db/test_git.py", line 53, in test_writing
    self._assert_object_writing(gdb)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/db/lib.py", line 105, in _assert_object_writing
    self.failUnlessRaises(BadObject, db.info, sha)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestGitDB' object has no attribute 'failUnlessRaises'

======================================================================
ERROR: test_basics (gitdb.test.db.test_loose.TestLooseDB)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/lib.py", line 86, in wrapper
    return func(self, path)
           ^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/db/test_loose.py", line 21, in test_basics
    self._assert_object_writing(ldb)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/db/lib.py", line 105, in _assert_object_writing
    self.failUnlessRaises(BadObject, db.info, sha)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestLooseDB' object has no attribute 'failUnlessRaises'
-------------------- >> begin captured logging << --------------------
root: INFO: You can set the GITDB_TEST_GIT_REPO_BASE environment variable to a .git repository of your choice - defaulting to the gitdb repository
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_writing (gitdb.test.db.test_pack.TestPackDB)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/lib.py", line 86, in wrapper
    return func(self, path)
           ^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/lib.py", line 113, in wrapper
    return func(self, path)
           ^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/db/test_pack.py", line 87, in test_writing
    self.failUnlessRaises(BadObject, pdb.partial_to_complete_sha, b'\0\0', 4)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestPackDB' object has no attribute 'failUnlessRaises'
-------------------- >> begin captured logging << --------------------
root: INFO: You can set the GITDB_TEST_GIT_REPO_BASE environment variable to a .git repository of your choice - defaulting to the gitdb repository
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_pack_index (gitdb.test.test_pack.TestPack)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/test_pack.py", line 128, in test_pack_index
    self._assert_index_file(index, version, size)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/test_pack.py", line 76, in _assert_index_file
    self.failUnlessRaises(ValueError, index.partial_sha_to_index, "\0", 2)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestPack' object has no attribute 'failUnlessRaises'

======================================================================
ERROR: test_compressed_writer (gitdb.test.test_stream.TestStream)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/test_stream.py", line 138, in test_compressed_writer
    self.failUnlessRaises(OSError, os.close, fd)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestStream' object has no attribute 'failUnlessRaises'
-------------------- >> begin captured logging << --------------------
root: INFO: You can set the GITDB_TEST_GIT_REPO_BASE environment variable to a .git repository of your choice - defaulting to the gitdb repository
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_lockedfd (gitdb.test.test_util.TestUtils)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/gitdb-4.0.5/gitdb/test/test_util.py", line 43, in test_lockedfd
    self.failUnlessRaises(AssertionError, lfd.rollback)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'TestUtils' object has no attribute 'failUnlessRaises'

----------------------------------------------------------------------
Ran 23 tests in 16.896s

FAILED (SKIP=1, errors=7)

Removed many old deprecated unittest features:
    TestCase method aliases failUnlessEqual, failIfEqual, failUnless, failIf, failUnlessRaises, failUnlessAlmostEqual, failIfAlmostEqual (deprecated in Python 3.1), assertEquals, assertNotEquals, assert_, assertAlmostEquals, assertNotAlmostEquals, assertRegexpMatches, assertRaisesRegexp (deprecated in Python 3.2), and assertNotRegexpMatches (deprecated in Python 3.5).
    Undocumented and broken TestCase method assertDictContainsSubset (deprecated in Python 3.2).
    Undocumented <unittest.TestLoader.loadTestsFromModule> TestLoader.loadTestsFromModule() parameter use_load_tests (deprecated and ignored since Python 3.2).
    An alias of the TextTestResult class: _TextTestResult (deprecated in Python 3.2).

(Contributed by Serhiy Storchaka in bpo-45162.)

https://bugs.python.org/issue45162
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/02984913-python-gitdb/

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

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 Hugo van Kemenade 2022-01-10 14:23:23 UTC
Fixed upstream, August 2021: https://github.com/gitpython-developers/gitdb/pull/73

Released in 4.0.8, Oct 2021.

Comment 2 Ben Cotton 2022-02-08 21:13:57 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle.
Changing version to 36.


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