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

fixed errors and suppressed deprecation warning #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fuggles-5555
Copy link

Running patator gave me the following errors:

patator/patator.py:27: SyntaxWarning: invalid escape sequence '\w'
  '''
patator/patator.py:2674: SyntaxWarning: invalid escape sequence '\w'
  ('prompt_re', 'regular expression to match prompts [\w+:]'),
patator/patator.py:2687: SyntaxWarning: invalid escape sequence '\w'
  def execute(self, host, port='23', inputs=None, prompt_re='\w+:', timeout='20', persistent='0'):
patator/patator.py:3388: SyntaxWarning: invalid escape sequence '\w'
  ('prompt_re', 'regular expression to match prompts [\w+:]'),
patator/patator.py:3410: SyntaxWarning: invalid escape sequence '\w'
  def execute(self, host, port='513', luser='root', user='', password=None, prompt_re='\w+:', timeout='10', persistent='0'):
patator/patator.py:4281: SyntaxWarning: invalid escape sequence '\d'
  m = re.search(' Authentication only, exit status (\d+)', err)
patator/patator.py:4998: SyntaxWarning: invalid escape sequence '\('
  mesg = 'Handshake returned: %s (%s)' % (re.search('SA=\((.+) LifeType', out).group(1), re.search('\t(.+) Mode Handshake returned', out).group(1))
patator/patator.py:2658: DeprecationWarning: 'telnetlib' is deprecated and slated for removal in Python 3.13
  from telnetlib import Telnet

I appreciate these are only warnings, but I've escaped the SyntaxWarnings in the pull request, and I've suppressed the DeprecationWarning.

The SyntaxWarnings have been fixed by double escaping the mentioned characters.
The DeprecationWarning was fixed by importing the warning library, then catching and ignoring telnetlib warnings.

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

Successfully merging this pull request may close these issues.

1 participant