Fixing Python scanner.

Follow up on @laiqu 's refactoring to extract the entry decoding function to a module of its own.