fabiobatalha / crossrefapi

A python library that implements the Crossref API.
BSD 2-Clause "Simplified" License
265 stars 44 forks source link

fix:timeout not working as intended by user. #43

Closed Ankush-Chander closed 2 years ago

Ankush-Chander commented 2 years ago

Issue: In case of works.query timeout was not working as expected.

Way to replicate the issue:

from crossref.restful import Works
title = "Show, Tell and Summarize: Dense Video Captioning Using Visual Cue Aided Sentence Summarization"
author = "Zhiwang  Zhang"
works = Works(timeout=(1,1)) # connect timeout, read timeout
w1 = works.query(bibliographic=title, author=author).sort("relevance")
for record in w1:
    print(record)

Above code should timeout after 1 second.

Changes made: