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

DeprecationWarning: urllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() instead (IDFGH-4364) #6200

Closed
askpatrickw opened this issue Dec 3, 2020 · 1 comment

Comments

@askpatrickw
Copy link

For when you get around to Python 3.9 support.

url_type, path = splittype(url)

idf_tools.py:308: DeprecationWarning: urllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() instead

url_type, path = splittype(url) is the current code.

url_type = urllib.parse.urlparse(url)['scheme']
path = urllib.parse.urlparse(url)['path']  # You may also need params and query... not sure. 

You may also ned to join netloc and path if its a file.

urllib.parse.splittype(url3)
('file', '//localhost/etc/fstab')

urllib.parse.urlparse(url3)
ParseResult(scheme='file', netloc='localhost', path='/etc/fstab', params='', query='', fragment='')
@github-actions github-actions bot changed the title DeprecationWarning: urllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() instead DeprecationWarning: urllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() instead (IDFGH-4364) Dec 3, 2020
@Kiznoh
Copy link
Contributor

Kiznoh commented Dec 4, 2020

Hi Patrick,
Thank you for your report.

@igrr igrr closed this as completed in c305ceb Feb 1, 2021
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

No branches or pull requests

2 participants