get_page_content seemed to throw an exception when I tried locally. It turned out that with actually calls the __enter__ and __exit__ methods on a file descriptor. While file has those methods, urlopen doesn't (which explains why the tests passed locally) - it always throws an AttributeError. This should just work if the thing's properly closed.
get_page_content
seemed to throw an exception when I tried locally. It turned out thatwith
actually calls the__enter__
and__exit__
methods on a file descriptor. Whilefile
has those methods,urlopen
doesn't (which explains why the tests passed locally) - it always throws anAttributeError
. This should just work if the thing's properly closed.