Skip to content

Commit

Permalink
Merge pull request #329 from jborean93/regex-raw
Browse files Browse the repository at this point in the history
Fix invalid regex escape sequences
  • Loading branch information
jborean93 authored Aug 26, 2021
2 parents 3fa5dbb + eda9f09 commit 0c62eb1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

### Version 0.4.3
- Fix invalid regex escape sequences.

### Version 0.4.2
- Dropped Python 3.5 from support matrix as it is EOL.
- Remove dependency on `distutils` that is deprecated in Python 3.10.
Expand Down
2 changes: 1 addition & 1 deletion winrm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _strip_namespace(self, xml):
@staticmethod
def _build_url(target, transport):
match = re.match(
'(?i)^((?P<scheme>http[s]?)://)?(?P<host>[0-9a-z-_.]+)(:(?P<port>\d+))?(?P<path>(/)?(wsman)?)?', target) # NOQA
r'(?i)^((?P<scheme>http[s]?)://)?(?P<host>[0-9a-z-_.]+)(:(?P<port>\d+))?(?P<path>(/)?(wsman)?)?', target) # NOQA
scheme = match.group('scheme')
if not scheme:
# TODO do we have anything other than HTTP/HTTPS
Expand Down
2 changes: 1 addition & 1 deletion winrm/vendor/requests_kerberos/kerberos_.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def _negotiate_value(response):
else:
# There's no need to re-compile this EVERY time it is called. Compile
# it once and you won't have the performance hit of the compilation.
regex = re.compile('(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I)
regex = re.compile(r'(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I)
_negotiate_value.regex = regex

authreq = response.headers.get('www-authenticate', None)
Expand Down

0 comments on commit 0c62eb1

Please sign in to comment.