allow a dict as uri, issue 1316, thanks Alan