Skip to content

Commit 2e92652

Browse files
committed
Changed a regex to use an r string. Added decoding of command pipe output.
- Legacy-Id: 16374
1 parent d460721 commit 2e92652

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

ietf/submit/checkers.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,16 @@ def check_file_txt(self, path):
8080

8181
cmd = "%s %s %s" % (settings.IDSUBMIT_IDNITS_BINARY, self.options, path)
8282
code, out, err = pipe(cmd)
83+
out = out.decode()
84+
err = err.decode()
8385
if code != 0 or out == "":
8486
message = "idnits error: %s:\n Error %s: %s" %( cmd, code, err)
8587
log(message)
8688
passed = False
8789

8890
else:
8991
message = out
90-
if re.search("\s+Summary:\s+0\s+|No nits found", out):
92+
if re.search(r"\s+Summary:\s+0\s+|No nits found", out):
9193
passed = True
9294
else:
9395
passed = False
@@ -204,6 +206,8 @@ def check_file_txt(self, path):
204206
cmd_version = VersionInfo.objects.get(command=command).version
205207
cmd = cmd_template.format(libs=modpath, model=path)
206208
code, out, err = pipe(cmd)
209+
out = out.decode()
210+
err = err.decode()
207211
if code > 0 or len(err.strip()) > 0 :
208212
error_lines = err.splitlines()
209213
assertion('len(error_lines) > 0')
@@ -235,6 +239,8 @@ def check_file_txt(self, path):
235239
cmd = cmd_template.format(model=path, rfclib=settings.SUBMIT_YANG_RFC_MODEL_DIR, tmplib=workdir,
236240
draftlib=settings.SUBMIT_YANG_DRAFT_MODEL_DIR, ianalib=settings.SUBMIT_YANG_IANA_MODEL_DIR, )
237241
code, out, err = pipe(cmd)
242+
out = out.decode()
243+
err = err.decode()
238244
if code > 0 or len(err.strip()) > 0:
239245
err_lines = err.splitlines()
240246
for line in err_lines:

0 commit comments

Comments
 (0)