pytvdbapi
pytvdbapi copied to clipboard
AttributeError raised by when getting series by TheTVDB ID
When fetching a series with api.get_series(), rarely an AttributeError will be raised. I've encounted this one, and one that reads "'NoneType' objest has no attribute 'close'"
File "", line 139, in get_tvdb_series
return self.tvdb.get_series(series_id, 'en')
File "e:\Users\XXX\AppData\Local\Programs\Python\Python36-32\
lib\site-packages\pytvdbapi\utils.py", line 47, in __wrapper__
return func(*args, **kwargs)
File "e:\Users\XXX\AppData\Local\Programs\Python\Python36-32\
lib\site-packages\pytvdbapi\api.py", line 729, in get_series
data = self.loader.load(url, cache)
File "e:\Users\XXX\AppData\Local\Programs\Python\Python36-32\
lib\site-packages\pytvdbapi\loader.py", line 64, in load
response, content = self.http.request(url, headers=header)
File "e:\Users\XXX\AppData\Local\Programs\Python\Python36-32\
lib\site-packages\httplib2\__init__.py", line 1292, in request
(response, new_content) = self._request(conn, authority, uri, request_uri, m
ethod, body, headers, redirections, cachekey)
File "e:\Users\XXX\AppData\Local\Programs\Python\Python36-32\
lib\site-packages\httplib2\__init__.py", line 1072, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, he
aders)
File "e:\Users\XXX\AppData\Local\Programs\Python\Python36-32\
lib\site-packages\httplib2\__init__.py", line 1054, in _conn_request
content = response.read()
File "e:\Users\XXX\AppData\Local\Programs\Python\Python36-32\
lib\http\client.py", line 462, in read
s = self._safe_read(self.length)
File "e:\Users\XXX\AppData\Local\Programs\Python\Python36-32\
lib\http\client.py", line 612, in _safe_read
chunk = self.fp.read(min(amt, MAXAMOUNT))
AttributeError: 'NoneType' object has no attribute 'read'