Currently, when an error occurs in a module loaded through a loader in sys.meta_path with no direct file name correlation on the filesystem, the traceback source line is empty as such:
File "/Users/mark/Development/Projects/Rave/rave/rave/game.py", line 65, in run
self.window.render(None)
File "/.modules/sdl2/video/window.py", line 86, in render
File "/.modules/sdl2/video/window.py", line 259, in swap
KeyboardInterrupt
While the filename has no direct mapping on the file system, what it can do is just do the equivalent of module.__loader__.get_source('module') to retrieve the source code to find the appropriate line in, and only if that fails fall back on trying to interpret the module file name as a normal file system path.
|