Currently we only strip the Python extension when the file exists on disk because we assumed that if it didn't exist it was a module. However, with the change from D89334 this is no longer the case as we want to be able to import a relative path to a .py as a module. Since we always import a scripting module as a "python module" we should always strip the extension if present.
This is necessary to write a test with a .py extension as suggested by Dave: