Bug 2019309 - python-nose fails to build with Python 3.11: ImportError: cannot import name '_TextTestResult' from 'unittest'
Summary: python-nose fails to build with Python 3.11: ImportError: cannot import name ...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-nose
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.11
TreeView+ depends on / blocked
 
Reported: 2021-11-02 07:44 UTC by Tomáš Hrnčiar
Modified: 2021-11-09 16:06 UTC (History)
5 users (show)

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


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-11-02 07:44:26 UTC
python-nose fails to build with Python 3.11.0a1.

Traceback (most recent call last):
  File "/builddir/build/BUILD/nose-1.3.7/build/tests/nose/result.py", line 14, in <module>
    from unittest.runner import _TextTestResult
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name '_TextTestResult' from 'unittest.runner' (/usr/lib64/python3.11/unittest/runner.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/nose-1.3.7/selftest.py", line 59, in <module>
    import nose
    ^^^^^^^^^^^
  File "/builddir/build/BUILD/nose-1.3.7/build/tests/nose/__init__.py", line 1, in <module>
    from nose.core import collector, main, run, run_exit, runmodule
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/nose-1.3.7/build/tests/nose/core.py", line 15, in <module>
    from nose.result import TextTestResult
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/nose-1.3.7/build/tests/nose/result.py", line 16, in <module>
    from unittest import _TextTestResult
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name '_TextTestResult' from 'unittest' (/usr/lib64/python3.11/unittest/__init__.py)

Removed many old deprecated unittest features:
    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/02916315-python-nose/

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

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 already included in Fedora 35. 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 2 Miro Hrončok 2021-11-09 16:06:12 UTC
Merged into the rawhide branch.


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