This is a matter of style, but I fell that 63..66 should be replaced by:
`return os.path.splitext(filename) if filename else None`

(the `else None` is redundant but helps read the code... and helps some refactoring tools) 

[4 lines to 1], with some dev groups this is a *must*!