This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Migrating python 2.7 to 3.6 using 2to3 tool
Type: behavior Stage: resolved
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, mskarthik28
Priority: normal Keywords:

Created on 2022-01-07 07:27 by mskarthik28, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (2)
msg409950 - (view) Author: Karthik S (mskarthik28) Date: 2022-01-07 07:27
Greeting of the day to all..

I would like to address few queries as mentioned in the below.

python 2.7 code is running fine on RHEL 7.9,we are migrating to python3 from Python2 using 2to3 on RHEL 7.9. 
After migrating, When we run our products in python 3.6,we are facing some modules are not imported error.

Example 1: 
    from IN import AF_INET6
ModuleNotFoundError: No module named 'IN'

In 2.7 IN modules coming from python-libs package,but in python3-libs doesnt find the IN module.
/usr/lib64/python2.7/plat-linux2/IN.py is avaialbe in python-libs-2.7.5-89.el7.x86_64 ,but it is not avilable in python3-libs.

[root@opt]# rpm -ql python-libs | grep -i IN.py
/usr/lib64/python2.7/plat-linux2/IN.py
/usr/lib64/python2.7/plat-linux2/IN.pyc
/usr/lib64/python2.7/plat-linux2/IN.pyo

[root@ opt]# rpm -ql python3-libs | grep -i IN.py
[root@ opt]#

Example2: 

    from yum import YumBase
ModuleNotFoundError: No module named 'yum'

In RHEL 7.9 python 2.7 /usr/lib/python2.7/site-packages/yum is avaialbe , but in RHEL 7.9 with python3 it is not available.python3 is require python3-dnf but this is avaialbe from RHEL 8,doesnt have in RHEL 7.9. 

Kindly help, how to overcome this kind of issue, it would be more helpful for us to move forward.

We are using 2to3 migration tool for converting py2 to py3.
msg409964 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2022-01-07 14:32
Porting questions don't belong on the bug tracker. And we don't support 2.7 any more, in any event.

You'll need to find python 3 versions of all of your packages. Unfortunately we can't help you with that.

There used to be a python-porting mailing list, but it's been deleted. Maybe someone on the the python-list mailing list could point you in the right direction.
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90446
2022-01-07 14:32:16eric.smithsetstatus: open -> closed

type: compile error -> behavior

nosy: + eric.smith
messages: + msg409964
resolution: not a bug
stage: resolved
2022-01-07 07:27:16mskarthik28create