urllib in 2.x and 3.x are different so that's why an exception is raised in 3.x and not in 2.x