Bug 1928081 - python-utils fails to build with Python 3.10: AttributeError: 'NoneType' object has no attribute '__suppress_context__'
Summary: python-utils fails to build with Python 3.10: AttributeError: 'NoneType' obje...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: python-utils
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.10
TreeView+ depends on / blocked
 
Reported: 2021-02-12 10:59 UTC by Tomáš Hrnčiar
Modified: 2021-03-03 00:31 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-03-03 00:31:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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


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