BUG: use context manager for urlopen