Skip to content

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

Description

@fugaw1

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions