Currently when a scripts file name is the same as the name of a module the error message is confusing, could the error message be changed to tell folks that the script name is the same as a module being imported.
It’s great to make error message clearer about what is going on. I’m not sure exactly what scenario you are describing. Could you give us a complete concrete example to look at, including the error message you get?
Is this change similar to what you’re asking for? gh-95754: Better error when script shadows a standard library or third party module by hauntsaninja · Pull Request #113769 · python/cpython · GitHub