scripts/igt_doc: fix a deprecation warning
PATCH 1/1 scripts/igt_doc: fix a deprecation warning
The regular expression usage has count as the third parameter, which results in this error message:
DeprecationWarning: 'count' is passed as positional argument
So the current usage incorrectly uses the flag value as a count.
Specify the parameter name to get the correct usage.
--- scripts/igt_doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/igt_doc.py +1 -1
@@ -37,7 +37,7 @@ class IgtTestList(TestList): run_type = "other" else: for driver in self.drivers: - result = re.sub(r"^" + driver + r"[\W_]*", "", run_type, re.IGNORECASE) + result = re.sub(r"^" + driver + r"[\W_]*", "", run_type, flags = re.IGNORECASE) if result != run_type: driver_set = set([driver]) run_type = result
Signature · 1 line
2.50.0
Hi Michael,
Quoted 10 lines · Michael J. Ruhl
The regular expression usage has count as the third parameter, which results in this error message:
DeprecationWarning: 'count' is passed as positional argument
So the current usage incorrectly uses the flag value as a count.
Specify the parameter name to get the correct usage.
Signed-off-by Michael J. Ruhl <[email protected]>
Quoted 20 lines
--- scripts/igt_doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/igt_doc.py +1
-1@@ -37,7 +37,7 @@ class IgtTestList(TestList): run_type = "other" else: for driver in self.drivers: - result = re.sub(r"^" + driver + r"[\W_]*", "", run_type, re.IGNORECASE) + result = re.sub(r"^" + driver + r"[\W_]*", "", run_type, flags = re.IGNORECASE) if result != run_type: driver_set = set([driver]) run_type = resultSignature · 1 line
2.50.0
Hi Michael,
Quoted 10 lines · Michael J. Ruhl
The regular expression usage has count as the third parameter, which results in this error message:
DeprecationWarning: 'count' is passed as positional argument
So the current usage incorrectly uses the flag value as a count.
Specify the parameter name to get the correct usage.
Signed-off-by Michael J. Ruhl <[email protected]>
Thank you, I already merged it but please see one nit below.
Quoted 9 lines
--- scripts/igt_doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/igt_doc.py +0
-0
scripts/igt_doc.py class IgtTestList(TestList): · line 40
Quoted 5 lines
scripts/igt_doc.py +1
-1@@ -37,7 +37,7 @@ class IgtTestList(TestList): run_type = "other" else: for driver in self.drivers: - result = re.sub(r"^" + driver + r"[\W_]*", "", run_type, re.IGNORECASE) + result = re.sub(r"^" + driver + r"[\W_]*", "", run_type, flags = re.IGNORECASE)
According to Python doc, there should be also count=0:
result = re.sub(r"^" + driver + r"[\W_]*", "", run_type, count = 0, flags = re.IGNORECASE)
Please see: https://docs.python.org/3/library/re.html#re.sub
Regards,
Kamil
Quoted 6 lines
scripts/igt_doc.py +0
-0if result != run_type: driver_set = set([driver]) run_type = resultSignature · 1 line
2.50.0
Quoted 38 lines
-----Original Message-----
From: Kamil Konieczny <[email protected]>
Sent: Wednesday, July 16, 2025 7:49 AM
To: Ruhl, Michael J <[email protected]>
Cc: [email protected]; De Marchi, Lucas <[email protected]>; Vivi, Rodrigo <[email protected]>
Subject: Re: [PATCH]scripts/igt_doc: fix a deprecation warningHi Michael,
Quoted 10 lines · Michael J. Ruhl
The regular expression usage has count as the third parameter, which results in this error message:
DeprecationWarning: 'count' is passed as positional argument
So the current usage incorrectly uses the flag value as a count.
Specify the parameter name to get the correct usage.
Signed-off-by Michael J. Ruhl <[email protected]>Thank you, I already merged it but please see one nit below.
scripts/igt_doc.py class IgtTestList(TestList): · line 40
Quoted 13 lines
--- scripts/igt_doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/igt_doc.py +0
-1@@ -37,7 +37,7 @@ class IgtTestList(TestList): run_type = "other" else: for driver in self.drivers: - result = re.sub(r"^" + driver + r"[\W_]*", "", run_type,re.IGNORECASE)
scripts/igt_doc.py class IgtTestList(TestList): · line 40
Quoted 1 line
scripts/igt_doc.py +1
-0+ result = re.sub(r"^" + driver + r"[\W_]*", "", run_type, flags =
Quoted 8 lines
re.IGNORECASE)
According to Python doc, there should be also count=0:
result =
re.sub(r"^" + driver + r"[\W_]*", "", run_type, count = 0, flags = re.IGNORECASE)Please see: https://docs.python.org/3/library/re.html#re.sub
Hi Kamil,
My understanding was that that indicated that the default value of count/flags if they where not explicitly set.... Looking at the examples, I see they are setting flags, but not count.
I can provide an update with count = 0, but it is not clear to me that that is required.
Thoughts?
Mike
Quoted 9 lines
Regards,
KamilQuoted 6 lines
scripts/igt_doc.py +0
-1if result != run_type: driver_set = set([driver]) run_type = result --2.50.0
Hi Ruhl,,
Quoted 49 lines · Michael J
Quoted 38 lines
-----Original Message-----
From: Kamil Konieczny <[email protected]>
Sent: Wednesday, July 16, 2025 7:49 AM
To: Ruhl, Michael J <[email protected]>
Cc: [email protected]; De Marchi, Lucas <[email protected]>; Vivi, Rodrigo <[email protected]>
Subject: Re: [PATCH]scripts/igt_doc: fix a deprecation warningHi Michael,
Quoted 10 lines · Michael J. Ruhl
The regular expression usage has count as the third parameter, which results in this error message:
DeprecationWarning: 'count' is passed as positional argument
So the current usage incorrectly uses the flag value as a count.
Specify the parameter name to get the correct usage.
Signed-off-by Michael J. Ruhl <[email protected]>Thank you, I already merged it but please see one nit below.
scripts/igt_doc.py class IgtTestList(TestList): · line 40
Quoted 13 lines
--- scripts/igt_doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/igt_doc.py +0
-1@@ -37,7 +37,7 @@ class IgtTestList(TestList): run_type = "other" else: for driver in self.drivers: - result = re.sub(r"^" + driver + r"[\W_]*", "", run_type,re.IGNORECASE)
scripts/igt_doc.py class IgtTestList(TestList): · line 40
Quoted 1 line
scripts/igt_doc.py +1
-0+ result = re.sub(r"^" + driver + r"[\W_]*", "", run_type, flags =Quoted 8 lines
re.IGNORECASE)
According to Python doc, there should be also count=0:
result =
re.sub(r"^" + driver + r"[\W_]*", "", run_type, count = 0, flags = re.IGNORECASE)Please see: https://docs.python.org/3/library/re.html#re.sub
Hi Kamil,
Quoted 7 lines
My understanding was that that indicated that the default value of count/flags if they where not explicitly set.... Looking at the examples, I see they are setting flags, but not count.
I can provide an update with count = 0, but it is not clear to me that that is required.
Thoughts?
I am not python programmer, not sure if that AI suggestion is true.
After second reading of examples from above link I see there is exactly same code you wrote, no count and flags only, so imho no need for more changes.
Regards,
Kamil
Quoted 12 lines
Mike
Quoted 9 lines
Regards,
KamilQuoted 6 lines
scripts/igt_doc.py +0
-1if result != run_type: driver_set = set([driver]) run_type = result --2.50.0