urlopen cannot be used in a with statement directly