From ca42e2a2e9d527fae146edb2ce734b207a67677f Mon Sep 17 00:00:00 2001 From: Andy Freeland Date: Tue, 27 Nov 2018 13:49:47 -0800 Subject: [PATCH] Add noqa comments for flake8 W605 W605 warns of invalid escape sequences in non-`r` strings. Unfortunately, there's no Python 2/3 compatible way of marking `r` bytestrings. `rb` is invalid on Python 2, and `r` is for text strings on Python 3. --- sops/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sops/__init__.py b/sops/__init__.py index 19d04ae7f..fa8a1d739 100644 --- a/sops/__init__.py +++ b/sops/__init__.py @@ -894,11 +894,11 @@ def decrypt(value, key, aad=b'', stash=None, digest=None, unencrypted=False): digest.update(bvalue) return value - valre = b'^ENC\[AES256_GCM,data:(.+),iv:(.+),tag:(.+)' + valre = b'^ENC\[AES256_GCM,data:(.+),iv:(.+),tag:(.+)' # noqa: W605 # extract fields using a regex if A_is_newer_than_B(INPUT_VERSION, '0.8'): valre += b',type:(.+)' - valre += b'\]' + valre += b'\]' # noqa: W605 res = re.match(valre, value.encode('utf-8')) # if the value isn't in encrypted form, return it as is if res is None: @@ -1422,7 +1422,7 @@ def tree_path_comp(comp, path): comp = comp[0:len(comp)-1] comp = comp.replace('"', '', 2) comp = comp.replace("'", "", 2) - if re.search(b'^\d+$', comp.encode('utf-8')): + if re.search(b'^\d+$', comp.encode('utf-8')): # noqa: W605 return int(comp) else: return comp