Let filetype() raise instead of returning None. Closes #171

Open username-removed-71423 requested to merge filetype-fix into master