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

Testing: Check variables exist before accessing them, and add type annotations to common/pcache #6715

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rdimaio
Copy link
Contributor

@rdimaio rdimaio commented Apr 22, 2024

Part of #6588.

@@ -1072,7 +1095,7 @@ def do_http_post(self, url, data):
# This will retry for up to 1 hour, at 2 minute intervals
while retry < 30:
try:
u = urlopen(url, data=urlencode(data))
u = urlopen(url, data=urlencode(data)) # type: ignore
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This type: ignore is due to the fact that the type returned by urlencode is not compatible with the type accepted by data in urlopen.

I'm not sure how this actually behaves at runtime, but due to the type mismatch I'm assuming that urlencode shouldn't be used in this context. I think it's best to address this separately.

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.

None yet

1 participant