advertools icon indicating copy to clipboard operation
advertools copied to clipboard

invalid escape codes in doc comments

Open stevenh opened this issue 1 year ago • 2 comments

When you load the advertools, in my case importing sitemap_to_df you get a number of SyntaxWarnings due to invalid escape codes in doc comments, specifcially:

.venv/lib/python3.12/site-packages/advertools/logs.py:1: SyntaxWarning: invalid escape sequence '\-'
  """
.venv/lib/python3.12/site-packages/advertools/robotstxt.py:1: SyntaxWarning: invalid escape sequence '\*'
  """
.venv/lib/python3.12/site-packages/advertools/crawlytics.py:1: SyntaxWarning: invalid escape sequence '\_'
  """
.venv/lib/python3.12/site-packages/advertools/youtube.py:310: SyntaxWarning: invalid escape sequence '\_'

I suspect the backslash is intended to be a literal one, so instead of '-' it should to be '\-'?

stevenh avatar Mar 17 '25 19:03 stevenh

Thanks a lot @stevenh

Yes, you're right. There is a bunch of rst strings that need escaping. I've created a fix, and should deploy a patch version soon. Will keep this issue until you confirm it's working on your side.

Appreciate the heads up!

eliasdabbas avatar Mar 23 '25 16:03 eliasdabbas

Any updates?

9en9i avatar Oct 17 '25 14:10 9en9i