Skip to content

Fix import typo in ping_url - #5424

Open
Anuragluck wants to merge 1 commit into
aboutcode-org:developfrom
Anuragluck:fix-ping-url-import
Open

Anuragluck wants to merge 1 commit into
aboutcode-org:developfrom
Anuragluck:fix-ping-url-import

Conversation

@Anuragluck

Copy link
Copy Markdown

Fixes #5423

ping_url() imported urlib.request instead of urllib.request, then fell back to the obsolete urllib2 module. On Python 3, this caused ModuleNotFoundError before the URL could be checked.

This PR imports urlopen from urllib.request, removes the Python 2 fallback, and adds tests for both successful and failed URL checks.

Tasks

Fixes aboutcode-org#5423

Signed-off-by: Anuragluck <anurag.at321@gmail.com>

This branch has not been deployed

No deployments
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.

ping_url() in commoncode/fetch.py raises ImportError on Python 3 (typo in import)

1 participant