In src/sage/doctest/sources.py the following code
sp = os.path.join(SAGE_LOCAL, 'lib', 'python', 'site-packages')
can easily be replaced by SAGE_LIB which is the intended location in any case.
Note that this is also the only call to SAGE_LOCAL in this file.
Component: doctest framework
Author: François Bissey
Branch/Commit: 6ccfd3a
Reviewer: Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/27191