diff --git a/sphinx/environment.py b/sphinx/environment.py index 0884eccad..522e2bd06 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -534,7 +534,7 @@ class BuildEnvironment: """ Custom decoding error handler that warns and replaces. """ - linestart = error.object.rfind('\n', None, error.start) + linestart = error.object.rfind('\n', 0, error.start) lineend = error.object.find('\n', error.start) if lineend == -1: lineend = len(error.object) lineno = error.object.count('\n', 0, error.start) + 1