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 1950229 - dnf with Python 3.10: DeprecationWarning: The distutils package is deprecated
Summary: dnf with Python 3.10: DeprecationWarning: The distutils package is deprecated
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: amatej
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-04-16 07:11 UTC by Lumír Balhar
Modified: 2021-06-15 07:21 UTC (History)
11 users (show)

Fixed In Version: dnf-4.8.0-1.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-15 07:21:34 UTC
Type: Bug


Attachments (Terms of Use)

Description Lumír Balhar 2021-04-16 07:11:50 UTC
Description of problem:
Python 3.10 will be the main Python interpreter in Fedora 35 and the distutils module is deprecated there and raises DeprecationWarning when imported.

Version-Release number of selected component (if applicable):
  Installed: dnf-0:4.7.0-1.fc35.noarch at Fri Apr 16 06:16:27 2021
  Built    :  at Thu Apr 15 15:19:35 2021

  Installed: rpm-0:4.16.1.3-1.fc35.x86_64 at Wed Apr  7 08:13:20 2021
  Built    : Fedora Project at Mon Mar 22 10:34:04 2021

Python 3.10.0a7

How reproducible:
Always

Steps to Reproduce:
1. run whatever dnf command, dnf --version for example

Actual results:
# dnf --version
/usr/lib/python3.10/site-packages/dnf/const.py:22: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.sysconfig
4.7.0
  Installed: dnf-0:4.7.0-1.fc35.noarch at Fri Apr 16 06:16:27 2021
  Built    :  at Thu Apr 15 15:19:35 2021

  Installed: rpm-0:4.16.1.3-1.fc35.x86_64 at Wed Apr  7 08:13:20 2021
  Built    : Fedora Project at Mon Mar 22 10:34:04 2021

Expected results:
No raised warning.

Additional info:
This import is unused: https://github.com/rpm-software-management/dnf/blob/1e0b9221006ec83cd8d359fc1a7d847e3443dfa2/dnf/persistor.py#L29

Comment 1 amatej 2021-04-19 13:22:23 UTC
Thank you for reporting this!
I made a PR which should fix it: https://github.com/rpm-software-management/dnf/pull/1758

Comment 2 Fedora Update System 2021-06-15 07:21:34 UTC
FEDORA-2021-78c5f8c03d has been pushed to the Fedora 35 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.