You are not getting an error -- if you did you would see the Error in copying
message printed.
The part you need to know is that every Python function returns a value. If you do not tell Python what value to return, Python returns None
.
So if you want the destination file to be returned to the caller, you have to do it yourself:
def fcopy(src):
dst = os.path.splitext(src)[0] + "a.pot"
try:
shutil.copy(src, dst)
return dst # this line should be added
except:
print("Error in copying " + src)
sys.exit(0)