From 7957b94c4d21d9b26113fb3d772fbbb4be9f864a Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 12 Feb 2019 19:06:09 -0500 Subject: [PATCH] Fix line numbers in files with \r --- buildsrht/blueprints/jobs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildsrht/blueprints/jobs.py b/buildsrht/blueprints/jobs.py index a2e0959..3e26e8c 100644 --- a/buildsrht/blueprints/jobs.py +++ b/buildsrht/blueprints/jobs.py @@ -235,7 +235,7 @@ def logify(text, task, log_url): + Markup('')) linenos = Markup('
\n\n\n')
     else:
-        nlines = text.encode().count(b'\n')
+        nlines = len(text.splitlines())
         text = Markup('
') + escape(text) + Markup('
') linenos = Markup('
')
     for no in range(1, nlines + 1):
-- 
2.38.5