Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a user agent and use requests error checking #24

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

sciencewhiz
Copy link
Contributor

No description provided.

@@ -62,14 +63,13 @@ def read_file(self, url, location=None):
# try:
# with codecs.open(url, 'r', self.encoding, errors='strict') as f: # type: ignore # NOQA
# text = f.read() # type: unicode
response = requests.get(url)
response = requests.get(
url, headers={"User-Agent": "sphinxext-remoteliteralinclude"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally you're supposed to put a version here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My copy and paste python skills failed me trying to get the version from setup.py from perusing stackexchange using importlib

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User agents for bots are a mess anyway, trying to evade blocks. If it works, it works

@sciencewhiz sciencewhiz merged commit 5444167 into wpilibsuite:main Nov 21, 2024
27 checks passed
@sciencewhiz sciencewhiz deleted the UserAgent branch November 21, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants