pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.63k stars 1.09k forks source link

add 'User-Agent'-header to pooch.retrieve #9782

Closed kmuehlbauer closed 6 days ago

kmuehlbauer commented 6 days ago
kmuehlbauer commented 6 days ago

& is there a reason you don't pass the downloader directly?

No, I was just somehow following the pooch tutorial :grin:

kmuehlbauer commented 6 days ago

Can probably just leave away the version from the string.

It might be useful to know the actual version for debugging, but I have no strong opinion.

mathause commented 6 days ago

Yes that's also good for me (just thought it's not worth debugging forever)

kmuehlbauer commented 6 days ago

Yes that's also good for me (just thought it's not worth debugging forever)

I was more thinking about situations where users experience these issues again. It might be that one time User-Agent is not enough to add to the headers.

kmuehlbauer commented 6 days ago

@mathause Thanks for the review. I think this is ready to go.

kmuehlbauer commented 6 days ago

Maybe I should add a whats-new-entry for more visibility.

keewis commented 6 days ago

for reference, python-requests (which pooch uses to do the download) adds a User-Agent of python-requests/<version>. My guess is that the combination of RTD servers + python-requests user agent was blocked, which is why changing to something else helps.