The error message is for the derived python file, rather than the the sage script. Loading scripts from within the interpreter using sage's builtin `load` function gives the expected line number. Assuming that this is incorrect behavior, is fixing this as simple as installing whaterver hooks that the `load` function uses on errors?