Mads Kiilerich <mads@kiilerich.com> [Mon, 22 Jul 2024 18:20:03 +0200] rev 51749
utils: fix resourceutil use of deprecated importlib.resources
Some importlib functionality was deprecated in 3.11 . The documentation on
https://docs.python.org/3.12/library/importlib.resources.html recommends using
the new .files() API that was introduced in 3.9.
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 20:32:07 +0100] rev 51748
cext: use sys.executable instead of deprecated Py_GetProgramFullPath
Fix warning with Python 3.13:
mercurial/cext/parsers.c: In function 'check_python_version':
mercurial/cext/parsers.c:1243:30: warning: 'Py_GetProgramFullPath' is deprecated [-Wdeprecated-declarations]
1243 | Py_GetProgramFullPath());
| ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/python3.13/Python.h:119,
from mercurial/cext/parsers.c:11:
/usr/include/python3.13/pylifecycle.h:43:43: note: declared here
43 | Py_DEPRECATED(3.13) PyAPI_FUNC(wchar_t *) Py_GetProgramFullPath(void);
| ^~~~~~~~~~~~~~~~~~~~~
At this point in time, the PyConfig struct memory has been released and the PyConfig API can't be used.
https://docs.python.org/3.13/c-api/init.html#c.Py_GetProgramFullPath recommands
using sys.executable instead. Let's assume that will work in all versions.
It would perhaps be better to use PySys_GetObject, but I prefer to stay
consistent with how the same function is retrieving sys.hexversion.
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 21:58:55 +0100] rev 51747
subrepoutil: pass re.sub 'count' argument by name
Python 3.13 started warning:
DeprecationWarning: 'count' is passed as positional argument
Mads Kiilerich <mads@kiilerich.com> [Thu, 11 Jan 2024 21:58:55 +0100] rev 51746
tests: pass re.MULTILINE to re.sub as 'flags' - not in 'count' position
This bug was caught by the new Python 3.13 warning:
DeprecationWarning: 'count' is passed as positional argument