Skip to content

Commit

Permalink
Mark strings with backslashes as raw strings
Browse files Browse the repository at this point in the history
  • Loading branch information
seveas committed Jul 8, 2024
1 parent cabe511 commit d7145cd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hpilo.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def __init__(self, hostname, login=None, password=None, timeout=60, port=443, pr
self.hponcfg = "/sbin/hponcfg"
hponcfg = 'hponcfg'
if platform.system() == 'Windows':
self.hponcfg = 'C:\Program Files\HP Lights-Out Configuration Utility\cpqlocfg.exe'
self.hponcfg = r'C:\Program Files\HP Lights-Out Configuration Utility\cpqlocfg.exe'
hponcfg = 'cpqlocfg.exe'
for path in os.environ.get('PATH','').split(os.pathsep):
maybe = os.path.join(path, hponcfg)
Expand Down Expand Up @@ -333,7 +333,7 @@ def _upload_file(self, filename, progress):
body = re.search('<body>(.*)</body>', data, flags=re.DOTALL).group(1)
body = re.sub('<[^>]*>', '', body).strip()
body = re.sub('Return to last page', '', body).strip()
body = re.sub('\s+', ' ', body).strip()
body = re.sub(r'\s+', ' ', body).strip()
raise IloError(body)
self.cookie = re.search('Set-Cookie: *(.*)', data).group(1)
self._debug(2, "Cookie: %s" % self.cookie)
Expand Down Expand Up @@ -429,7 +429,7 @@ def _communicate(self, xml, protocol, progress=None, save=True):
if self.protocol != ILO_LOCAL:
sock.write(self.XML_HEADER)
if b'$EMBED' in xml:
pre, name, post = re.compile(b'(.*)\$EMBED:(.*)\$(.*)', re.DOTALL).match(xml).groups()
pre, name, post = re.compile(rb'(.*)\$EMBED:(.*)\$(.*)', re.DOTALL).match(xml).groups()
sock.write(pre)
sent = 0
fwlen = os.path.getsize(name)
Expand Down

0 comments on commit d7145cd

Please sign in to comment.