Skip to content

[code sync] Merge code from sonic-net/sonic-platform-common:202511 to 202601#113

Merged
mssonicbld merged 1 commit into
Azure:202601from
mssonicbld:sonicbld/202601-merge
Jun 17, 2026
Merged

[code sync] Merge code from sonic-net/sonic-platform-common:202511 to 202601#113
mssonicbld merged 1 commit into
Azure:202601from
mssonicbld:sonicbld/202601-merge

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator

<br>* e0acb46 - (HEAD -> 202601, origin/202511) [sonic_pcie]: Fix regex string literals to use raw strings in pcie_common.py (#698) (2026-06-17) [mssonicbld]<br>

…mmon.py (#698)

#### Description
Updated regex patterns `p1` and `p2` in `PcieUtil.get_pcie_device()` to use raw string literals (`r"..."`) instead of plain string literals.

#### Motivation and Context
Python 3.12+ emits `DeprecationWarning` for invalid escape sequences in regular string literals (e.g., `\w`, `\s`, `\(`), and Python 3.13 raises a `SyntaxWarning` for these. Without raw strings, sequences like `\w` and `\s` are technically undefined escape sequences that happen to work today but will become `SyntaxError` in a future Python release. Using raw string literals (`r"..."`) is the correct and idiomatic way to write regex patterns in Python.

#### How Has This Been Tested?
- Verified the existing test suite passes: `pytest tests/pcie_common_test.py -v`
- Confirmed no `DeprecationWarning` or `SyntaxWarning` is emitted under Python 3.12/3.13
- No behavioral change, the regex patterns themselves are identical

#### Additional Information (Optional)
This is a purely cosmetic/correctness fix. The regex logic and matched groups are unchanged.

Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
@mssonicbld mssonicbld merged commit c6b1f1b into Azure:202601 Jun 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant