Closed ajratnam closed 1 year ago
Do you have any idea why
>>> split_unescape(r'foo\|bar', '|')
['foo|bar']
leads to radish/utils.py:190: DeprecationWarning: invalid escape sequence |
because i think that should not happen because we us a raw string
All modified lines are covered by tests :white_check_mark:
Comparison is base (
a515e15
) 87.26% compared to head (46580cc
) 87.26%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I think that's because you normally use r
strings to unescape any escaped sequence
but in our case \|
isn't an escape sequence so nothing is being escaped
>>> r'\|' == '\|'
True
>>> print(r'\|')
\|
>>> print('\|')
\|
imo, the fix for it would be using normal string with \\
or I think it maybe some issue with flake8 also
Yeah, I changed it to that, and my linter doesn't show me that error anymore. I think this fixes #443
thanks again merged and release with 0.17.0
split_unescape
function didn't have its docstring completly written. The example in the doc had a mistake, raw strings also cannot end with a single backslash.