Fixed #18404 -- Encoded storage location with filesystem or default encoding

Thanks andkit for the initial patch

- updated patch to work with Python 3: only decode if location is a
  binary type