#1101185 debian-goodies: DeprecationWarning in checkrestart due to positional maxsplit argument

#1101185#5
Date:
2025-03-24 12:29:32 UTC
From:
To:
Dear Maintainer,

I am experiencing a DeprecationWarning when running checkrestart. The warning message is as follows:

/usr/sbin/checkrestart:856: DeprecationWarning: 'maxsplit' is passed as positional argument
  data = re.split(r"\s+", output, 3)

This warning is due to a change in Python 3.13, where passing maxsplit as a positional argument to re.split() is deprecated. According to the Python documentation:

Deprecated since version 3.13: Passing maxsplit and flags as positional arguments is deprecated. In future Python versions they will be keyword-only parameters.
(https://docs.python.org/3/library/re.html)

To fix this issue, re.split(r"\s+", output, 3) should be modified to use maxsplit as a keyword argument:

data = re.split(r"\s+", output, maxsplit=3)

Best regards,

#1101185#10
Date:
2026-05-15 08:56:45 UTC
From:
To:
Hello,

I created a MR for that at
https://salsa.debian.org/debian/debian-goodies/-/merge_requests/13

Best regards
Uwe