Yes, I agree that's a non-intuitive behavior. The problem is that xpath() returns an empty list if the raw_content is empty. Maybe I should check a filename firstly and return a content only if the filename matches. What do you think?