Fix TypeError raised when _enc called with None (RhBug:1003220)