Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1928081

Summary: python-utils fails to build with Python 3.10: AttributeError: 'NoneType' object has no attribute '__suppress_context__'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-utilsAssignee: Miro Hrončok <mhroncok>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mhroncok, python-sig, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-03-03 00:31:00 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: 1890881    

Description Tomáš Hrnčiar 2021-02-12 10:59:57 UTC
python-utils fails to build with Python 3.10.0a5.


=================================== FAILURES ===================================
_____________________ [doctest] python_utils.logger.Logged _____________________
012 
013     >>> class MyClass(Logged):
014     ...     def __init__(self):
015     ...         Logged.__init__(self)
016     >>> my_class = MyClass()
017     >>> my_class.debug('debug')
018     >>> my_class.info('info')
019     >>> my_class.warning('warning')
020     >>> my_class.error('error')
021     >>> my_class.exception('exception')
UNEXPECTED EXCEPTION: AttributeError("'NoneType' object has no attribute '__suppress_context__'")
Traceback (most recent call last):
  File "/usr/lib64/python3.10/doctest.py", line 1340, in __run
    exec(compile(example.source, filename, "single",
  File "<doctest python_utils.logger.Logged[6]>", line 1, in <module>
  File "/builddir/build/BUILD/python-utils-2.4.0/python_utils/logger.py", line 56, in exception
    cls.logger.exception(msg, *args, **kwargs)
  File "/usr/lib64/python3.10/logging/__init__.py", line 1497, in exception
    self.error(msg, *args, exc_info=exc_info, **kwargs)
  File "/usr/lib64/python3.10/logging/__init__.py", line 1491, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/usr/lib64/python3.10/logging/__init__.py", line 1609, in _log
    self.handle(record)
  File "/usr/lib64/python3.10/logging/__init__.py", line 1619, in handle
    self.callHandlers(record)
  File "/usr/lib64/python3.10/logging/__init__.py", line 1681, in callHandlers
    hdlr.handle(record)
  File "/usr/lib64/python3.10/logging/__init__.py", line 963, in handle
    self.emit(record)
  File "/usr/lib/python3.10/site-packages/_pytest/logging.py", line 331, in emit
    super().emit(record)
  File "/usr/lib64/python3.10/logging/__init__.py", line 1102, in emit
    self.handleError(record)
  File "/usr/lib64/python3.10/logging/__init__.py", line 1094, in emit
    msg = self.format(record)
  File "/usr/lib64/python3.10/logging/__init__.py", line 938, in format
    return fmt.format(record)
  File "/usr/lib/python3.10/site-packages/_pytest/logging.py", line 92, in format
    return super().format(record)
  File "/usr/lib64/python3.10/logging/__init__.py", line 682, in format
    record.exc_text = self.formatException(record.exc_info)
  File "/usr/lib64/python3.10/logging/__init__.py", line 632, in formatException
    traceback.print_exception(ei[0], ei[1], tb, None, sio)
  File "/usr/lib64/python3.10/traceback.py", line 113, in print_exception
    te = TracebackException(type(value), value, tb, limit=limit, compact=True)
  File "/usr/lib64/python3.10/traceback.py", line 531, in __init__
    need_context = cause is None and not e.__suppress_context__
AttributeError: 'NoneType' object has no attribute '__suppress_context__'
/builddir/build/BUILD/python-utils-2.4.0/python_utils/logger.py:21: UnexpectedException

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

For all our attempts to build python-utils with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-utils/

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 Miro Hrončok 2021-02-13 09:07:15 UTC
https://bugs.python.org/issue43146