ctfr icon indicating copy to clipboard operation
ctfr copied to clipboard

SyntaxWarning invalid escape sequence (Python3.12.3) * with potential fix.

Open fugaw1 opened this issue 2 years ago • 1 comments

In python3.12.3 there's some new errors while using ctfr.py:

image

/home/sous/programs/ctfr/other:27: SyntaxWarning: invalid escape sequence '\ '
  b = '''
/home/sous/programs/ctfr/other:40: SyntaxWarning: invalid escape sequence '\.'
  return re.sub('.*www\.','',target,1).split('/')[0].strip()

A simple fix is adding the r to convert Python string literals:

image

def banner():
        global version
        b = r'''
          ____ _____ _____ ____  
         / ___|_   _|  ___|  _ \ 
        | |     | | | |_  | |_) |
        | |___  | | |  _| |  _ < 
         \____| |_| |_|   |_| \_\

     Version {v} - Hey don't miss AXFR!
    Made by Sheila A. Berta (UnaPibaGeek)
        '''.format(v=version)
        print(b)

def clear_url(target):
        return re.sub(r'.*www\.','',target,1).split('/')[0].strip()

Then no errors:

image

Thanks!

fugaw1 avatar Oct 10 '24 01:10 fugaw1

I did a PR that fixes the warnings https://github.com/UnaPibaGeek/ctfr/pull/42

AndreaF17 avatar May 06 '26 09:05 AndreaF17