mfcovington/pubmed-lookup

pubmed_lookup fails with specific UID: 18628094

Closed this issue · 5 comments

Hello,

pubmed_lookup fails with this path: https://www.ncbi.nlm.nih.gov/pubmed/18628094

Here is the error:

publication = Publication(lookup)
  File "C:\Python38\lib\site-packages\pubmed_lookup\pubmed_lookup.py", line 42, in __init__
    self.set_article_url(resolve_doi=resolve_doi)
  File "C:\Python38\lib\site-packages\pubmed_lookup\pubmed_lookup.py", line 186, in set_article_url
    response = urlopen(doi_url)
  File "C:\Python38\lib\urllib\request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Python38\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "C:\Python38\lib\urllib\request.py", line 640, in http_response
    response = self.parent.error(
  File "C:\Python38\lib\urllib\request.py", line 563, in error
    result = self._call_chain(*args)
  File "C:\Python38\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "C:\Python38\lib\urllib\request.py", line 755, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "C:\Python38\lib\urllib\request.py", line 531, in open
    response = meth(req, response)
  File "C:\Python38\lib\urllib\request.py", line 640, in http_response
    response = self.parent.error(
  File "C:\Python38\lib\urllib\request.py", line 563, in error
    result = self._call_chain(*args)
  File "C:\Python38\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "C:\Python38\lib\urllib\request.py", line 755, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "C:\Python38\lib\urllib\request.py", line 525, in open
    response = self._open(req, data)
  File "C:\Python38\lib\urllib\request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "C:\Python38\lib\urllib\request.py", line 502, in _call_chain
    result = func(*args)
  File "C:\Python38\lib\urllib\request.py", line 1360, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
  File "C:\Python38\lib\urllib\request.py", line 1321, in do_open
    r = h.getresponse()
  File "C:\Python38\lib\http\client.py", line 1322, in getresponse
    response.begin()
  File "C:\Python38\lib\http\client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "C:\Python38\lib\http\client.py", line 264, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "C:\Python38\lib\socket.py", line 669, in readinto
    return self._sock.recv_into(b)
  File "C:\Python38\lib\ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "C:\Python38\lib\ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host


I suspect you are using an old version of pubmed_lookup. Which version are you using?

The package was actually updated yesterday and now works for your URL. You can type pip freeze to determine the version.

You can use whichever one you'd like. Your issue was fixed yesterday in response to issue #3, so if you decide to use pubmed_lookup, just be sure to update to pubmed-lookup>=0.2.3.