Skip to content

fix invalid escape sequence (BugFix)#2533

Closed
rene-oromtz wants to merge 1 commit into
mainfrom
fix/escape-sequence
Closed

fix invalid escape sequence (BugFix)#2533
rene-oromtz wants to merge 1 commit into
mainfrom
fix/escape-sequence

Conversation

@rene-oromtz
Copy link
Copy Markdown
Contributor

Description

This is a minor PR to solve an invalid escape sequence on benchmarks/system/cpu_on_idle and benchmarks/system/disk_on_idle by using raw strings as suggested in https://docs.python.org/3/library/re.html#module-re

Resolved issues

Resolves #2532

Documentation

Tests

Tested locally on Noble

Before:

iostat -x -m 1 10 | python3 -c 'import sys, re; lines="".join(sys.stdin.readlines()); l=[float(n) for n in (re.findall("idle\n.*?(\S+)\n", lines))]; print(sum(l)/len(l),"%")'
<string>:1: SyntaxWarning: invalid escape sequence '\S'
89.652 %

After:

iostat -x -m 1 10 | python3 -c 'import sys, re; lines="".join(sys.stdin.readlines()); l=[float(n) for n in re.findall(r"idle\n.*?(\S+)\n", lines)]; print(sum(l)/len(l),"%")'
85.881 %

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.92%. Comparing base (1061d49) to head (a07320f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2533   +/-   ##
=======================================
  Coverage   58.92%   58.92%           
=======================================
  Files         476      476           
  Lines       48039    48039           
  Branches     8577     8577           
=======================================
  Hits        28306    28306           
  Misses      18841    18841           
  Partials      892      892           
Flag Coverage Δ
provider-base 34.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fernando79513
Copy link
Copy Markdown
Collaborator

I think this is addressed in this PR:
c28b30c

I will review it today.
Let me know if this fixes your issue.

@rene-oromtz
Copy link
Copy Markdown
Contributor Author

@fernando79513 Yes, that will do it! I swear I searched for a related bug but couldn't find any, maybe I was using a wrong keyword... Anyway, thanks for the heads up, I will close this PR as duplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Syntax Warning for invalid escape sequences

2 participants