TypeError: argument should be bytes, buffer or ASCII string, not 'NoneType'