crossrefapi icon indicating copy to clipboard operation
crossrefapi copied to clipboard

Depositor missing 'timeout' attribute used with self.do_http_request

Open nausicaa-rose opened this issue 1 year ago • 1 comments

Hello, I've found your library useful, but encountered a bug recently. crossref.restful.Depositor has several methods that expect to pass the the attribute self.timeout as a parameter to self.do_http_request, which throws this error: "AttributeError: 'Depositor' object has no attribute 'timeout'" because self.timeout is never initialized.

I did a quick patch by adding timeout=100 to Depositor.__init__()'s parameter list and adding self.timeout = timeout in the body of the init, which fixed the issue, at least in my very cursory testing.

If the above is an acceptable solution, I'm happy to test it out more thoroughly and submit a pull request. If you'd prefer another approach, I'd be happy to help with that as well.

Thanks for creating and maintaining this library!

nausicaa-rose avatar May 23 '24 20:05 nausicaa-rose

hello @nausicaa-rose sorry for the delay in answer you. Yes, you can submit a MR.

fabiobatalha avatar Jun 11 '24 19:06 fabiobatalha

Hi @fabiobatalha , do you please clarify when the provided PR will be merged, as I got same errors while trying to Deposit my xml. I can temporary extract the logic from the methods that have this issue right into my code as a temporary workaround to make it work, but it would be much better, if the provided PR will be reviewed and merged.

Engerrs avatar Sep 30 '24 19:09 Engerrs

I will look into this and get back to you today

On Mon, 30 Sep 2024 at 15:49 Yan @.***> wrote:

Hi @fabiobatalha https://github.com/fabiobatalha , do you please clarify when the provided PR will be merged, as I got same errors while trying to Deposit my xml. I can temporary extract the logic from the methods that have this issue right into my code as a temporary workaround to make it work, but it would be much better, if the provided PR will be reviewed and merged.

— Reply to this email directly, view it on GitHub https://github.com/fabiobatalha/crossrefapi/issues/64#issuecomment-2384025284, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD3CTUD5NKWIK5UCHX47LDZZGTMRAVCNFSM6AAAAABIGLOPUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBUGAZDKMRYGQ . You are receiving this because you were mentioned.Message ID: @.***>

fabiobatalha avatar Sep 30 '24 19:09 fabiobatalha

Hello @nausicaa-rose and @Engerrs, sorry about the delay. The new version is available 1.6.1.

fabiobatalha avatar Oct 08 '24 18:10 fabiobatalha