79310706

Date: 2024-12-27 01:05:41
Score: 1.5
Natty:
Report link

Thanks to the following bug report: https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/1408092

And email related: https://lists.ubuntu.com/archives/foundations-bugs/2017-June/323130.html

With this, I arrived at the conclusion that the change had to be made into the file /usr/share/aclocal-1.16/python.m4

According to the Python documentation https://peps.python.org/pep-0632/#migration-advice, instead of distutils.sysconfig I had to use sysconfig, but the options of this one did not give me the same output as distutils. My best option was to use sys.path, specifically the last item in the list:

$ python3 -c "import sys; print(sys.path)"

['', '/usr/lib/python311.zip', '/usr/lib/python3.11', '/usr/lib/python3.11/lib-dynload', '/usr/local/lib/python3.11/dist-packages', '/usr/lib/python3/dist-packages']

Replacing:

sitedir = sysconfig.get_path('purelib', scheme, vars={'base':'$am_py_prefix'})

With:

import sys
sitedir = sys.path[[-1]]

I found the 3rd Autotools video very helpful where they talk about escaping the [ ]

https://youtu.be/e-uYBb554LU?feature=shared&t=337

I replaced the line related to the pythondir variable and left the one related to pyexecdir so I could see the difference, then ran autoreconf -i and debuild..

checking for /usr/bin/python3.11 script directory (pythondir)... 
${PYTHON_PREFIX}/lib/python3/dist-packages
checking for /usr/bin/python3.11 extension module directory (pyexecdir)... 
${PYTHON_EXEC_PREFIX}/lib/python3.11/site-packages

Eureka!

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Blacklisted phrase (1): youtu.be
  • Long answer (-1):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Gustavo