Bug 2245825 - mom fails to build with Python 3.13: 'Logger' object has no attribute 'warn'
Summary: mom fails to build with Python 3.13: 'Logger' object has no attribute 'warn'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: mom
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Sandro Bonazzola
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-24 08:46 UTC by Karolina Surma
Modified: 2023-10-25 06:40 UTC (History)
5 users (show)

Fixed In Version: mom-0.6.4-6.fc40
Clone Of:
Environment:
Last Closed: 2023-10-25 06:40:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github oVirt mom pull 25 0 None Merged Use warning() method instead of warn() 2023-10-25 06:13:25 UTC

Description Karolina Surma 2023-10-24 08:46:31 UTC
mom fails to build with Python 3.13.0a1.


srcdir="." "./run_tests_local.sh" "."/*.py
...................................
======================================================================
ERROR: testPolicyAPI (GeneralTests.GeneralTests.testPolicyAPI)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/mom-0.6.4/mom/Policy/Parser.py", line 545, in get_code
    return parser.parse(tokens)
           ^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/mom-0.6.4/mom/Policy/spark.py", line 207, in parse
    self.error(tokens[i-1])
  File "/builddir/build/BUILD/mom-0.6.4/mom/Policy/spark.py", line 186, in error
    raise SystemExit
SystemExit

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/mom-0.6.4/mom/Policy/Policy.py", line 64, in set_policy
    self.code = get_code(Evaluator(), self._cat_policies())
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/mom-0.6.4/mom/Policy/Parser.py", line 547, in get_code
    raise PolicyError("parse error")
mom.Policy.Parser.PolicyError: parse error

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/builddir/build/BUILD/mom-0.6.4/tests/GeneralTests.py", line 74, in testPolicyAPI
    self.assertFalse(self.mom_instance.setPolicy(badPolicy))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/mom-0.6.4/mom/MOMFuncs.py", line 47, in setPolicy
    return self.threads['policy_engine'].rpc_set_policy(policy)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/mom-0.6.4/mom/PolicyEngine.py", line 83, in rpc_set_policy
    return self.policy.set_policy(None, policyStr)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/mom-0.6.4/mom/Policy/Policy.py", line 66, in set_policy
    self.logger.warn("Unable to load policy: %s" % e)
    ^^^^^^^^^^^^^^^^
AttributeError: 'Logger' object has no attribute 'warn'

According to https://docs.python.org/3.13/whatsnew/3.13.html:
logging: Remove undocumented and untested Logger.warn() and LoggerAdapter.warn() methods and logging.warn() function.
Deprecated since Python 3.3, they were aliases to the logging.Logger.warning() method, logging.LoggerAdapter.warning() method and logging.warning() function.
(Contributed by Victor Stinner in gh-105376.)

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06546749-mom/

For all our attempts to build mom with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/mom/

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.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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 Sandro Bonazzola 2023-10-25 06:13:25 UTC
This has been already fixed upstream: https://github.com/oVirt/mom/pull/25

Comment 2 Fedora Update System 2023-10-25 06:37:48 UTC
FEDORA-2023-a4693b8791 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-a4693b8791

Comment 3 Fedora Update System 2023-10-25 06:40:11 UTC
FEDORA-2023-a4693b8791 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.


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