Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fugaw1 opened this issue Oct 10, 2024 · 0 comments
Open

Comments

@fugaw1
Copy link

fugaw1 commented Oct 10, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant