Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid escape sequences in regexes #1273

Open
douglas-raillard-arm opened this issue Nov 20, 2024 · 0 comments
Open

Invalid escape sequences in regexes #1273

douglas-raillard-arm opened this issue Nov 20, 2024 · 0 comments
Labels

Comments

@douglas-raillard-arm
Copy link
Contributor

Describe the issue

WA seems to contain a fair amount of invalid escape sequences in its regexes, as can be see from wa --help output on Python 3.12, e.g.:

workload-automation/wa/utils/types.py:62: SyntaxWarning: invalid escape sequence '\ '

Run Log

/home/dourai01/Work/projects/workload-automation/wa/utils/types.py:62: SyntaxWarning: invalid escape sequence '\ '
  """
/home/dourai01/Work/projects/workload-automation/wa/utils/types.py:75: SyntaxWarning: invalid escape sequence '\ '
  """
/home/dourai01/Work/projects/workload-automation/wa/utils/types.py:86: SyntaxWarning: invalid escape sequence '\ '
  """
/home/dourai01/Work/projects/workload-automation/wa/utils/misc.py:254: SyntaxWarning: invalid escape sequence '\['
  _bash_color_regex = re.compile('\x1b\[[0-9;]+m')
/home/dourai01/Work/projects/workload-automation/wa/framework/plugin.py:38: SyntaxWarning: invalid escape sequence '\ '
  """
/home/dourai01/Work/projects/workload-automation/wa/framework/plugin.py:274: SyntaxWarning: invalid escape sequence '\ '
  """
/home/dourai01/Work/projects/workload-automation/wa/utils/serializer.py:16: SyntaxWarning: invalid escape sequence '\ '
  """
/home/dourai01/Work/projects/workload-automation/wa/framework/target/descriptor.py:683: SyntaxWarning: invalid escape sequence '\ '
  description = """
/home/dourai01/Work/projects/workload-automation/wa/instruments/perf.py:105: SyntaxWarning: invalid escape sequence '\ '
  description="""Provides labels for perf/simpleperf output for each optionstring.
/home/dourai01/Work/projects/workload-automation/wa/workloads/chrome/__init__.py:54: SyntaxWarning: invalid escape sequence '\*'
  Parameter('offline_mode', kind=bool, default=False, description='''
/home/dourai01/Work/projects/workload-automation/wa/workloads/chrome/__init__.py:86: SyntaxWarning: invalid escape sequence '\ '
  offline_pages = self.target.path.join(self.target.package_data_directory, self.package, 'app_chrome', 'Default', 'Offline\ Pages')
/home/dourai01/Work/projects/workload-automation/wa/workloads/exoplayer/__init__.py:40: SyntaxWarning: invalid escape sequence '\['
  'duration': '.*period \[(?P<duration>[0-9]+.*)\]',
/home/dourai01/Work/projects/workload-automation/wa/workloads/exoplayer/__init__.py:41: SyntaxWarning: invalid escape sequence '\['
  'end': '.*state \[.+, .+, E\]',
/home/dourai01/Work/projects/workload-automation/wa/workloads/exoplayer/__init__.py:42: SyntaxWarning: invalid escape sequence '\['
  'dropped_frames': '.*droppedFrames \[(?P<session_time>[0-9]+\.[0-9]+), (?P<count>[0-9]+)\]'
/home/dourai01/Work/projects/workload-automation/wa/workloads/geekbench/__init__.py:293: SyntaxWarning: invalid escape sequence '\-'
  """
/home/dourai01/Work/projects/workload-automation/wa/workloads/gfxbench/__init__.py:28: SyntaxWarning: invalid escape sequence '\('
  regex_template = 'name: \((?P<test_name>.*)\).*result: \((?P<result>.*)?\).* sub_result:.*\((?P<sub_result>.*?)?\).*'
/home/dourai01/Work/projects/workload-automation/wa/workloads/memcpy/__init__.py:29: SyntaxWarning: invalid escape sequence '\d'
  RESULT_REGEX = re.compile('Total time: ([\d.]+) s.*Bandwidth: ([\d.]+) MB/s', re.S)
/home/dourai01/Work/projects/workload-automation/wa/workloads/recentfling/__init__.py:104: SyntaxWarning: invalid escape sequence '\d'
  p = re.compile("Frames: \d+ latency: (?P<pct90>\d+)/(?P<pct95>\d+)/(?P<pct99>\d+) Janks: (?P<jank>\d+)\((?P<jank_pct>\d+)%\)")
/home/dourai01/Work/projects/workload-automation/wa/workloads/speedometer/__init__.py:109: SyntaxWarning: invalid escape sequence '\d'
  '(?:text|content-desc)="(?P<value>\d+.\d+)"[^>]*'
/home/dourai01/Work/projects/workload-automation/wa/workloads/speedometer/__init__.py:110: SyntaxWarning: invalid escape sequence '\/'
  '(?(Z)|resource-id="result-number")[^>]*\/>'
/home/dourai01/Work/projects/workload-automation/wa/workloads/vellamo/__init__.py:149: SyntaxWarning: invalid escape sequence '\d'
  iteration_result_regex = re.compile("VELLAMO RESULT: (Browser|Metal|Multicore) (\d+)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant