[Bug]: Invalid escape sequence in toolbox.py
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 0
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
Description
When running dtsbutler commands at ICEBERG, we get these invalid escape sequence warnings:
/exp/pdune/daq/dunecet/fddaq-v5.6.0-develop/install/timing/lib64/python/timing/cli/toolbox.py:107: SyntaxWarning: invalid escape sequence '\w'
if re.match('^\w+://.*', c) is None:
Right now, the warnings are just annoying. However, starting in Python 3.12, this becomes a syntax error. DUNE DAQ will likely upgrade our Python version at some point, so this should be fixed before then.
The solution is to use raw strings by adding r before the matching string:
if re.match(r'^\w+://.*', c) is None:
I'll submit a PR for this by CoB today.
Steps to reproduce
Build or setup a recent DUNE DAQ area, e.g., fddaq-v5.6.0 onward, on a node with access to a valid device. Run dtsbutler io <device> reset and observe the warning.
Version and environment
I'm running dtsbutler commands on iceberg03.fnal.gov using the device BOREAS_TLU_ICEBERG. I have a local build of fddaq-v5.6.0 with timing v7.14.0 checked out, though the problem line is unchanged in any recent version, including develop.
Impact
Small/Isolated
Anything else?
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open timing/cli/toolbox.py around line 107 and inspect the regular-expression string used by dtsbutler. Run dtsbutler io <device> reset in a recent DUNE DAQ setup and confirm the invalid escape warning no longer appears.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100