BUG: don't rely on sys.getdefaultencoding if we don't need to 

pending confirm on fixing #3360.