parse_filename: Fixed issues when file name contains dots.

Unfortunately the code of `parse_filename` seems to be duplicated. This patch should fix problems that arise when the file name contains dots. Obviously `name = fname.split('.')[0]` will not work in this case.

This should fix issue #6260.
okay, I updated the tests. Now the full path check is not really useful, since it is just mimicking the implementation. But I think that should be fine. After all it may become useful if the implementation of parse_filename should change.