If a name identified as local is passed to load_as with the filename extension intact. If the name was not identified as local then the extension does not exist.
I believe the expected behavior is for name to NOT have the extension in either case when loas_as is called.
I'd be happy to submit a patch and accompanying tests if that helps, but I want to confirm the expected behavior first.