adding back the check for spaces before encoding since url.format encodes spaces
bumped to 3.10.1