| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -456,6 +456,11 @@ def urlsplit(url, scheme='', allow_fragments=True): | |
| """ | ||
|
|
||
| url, scheme, _coerce_result = _coerce_args(url, scheme) | ||
|
|
||
| for b in _UNSAFE_URL_BYTES_TO_REMOVE: | ||
| url = url.replace(b, "") | ||
| scheme = scheme.replace(b, "") | ||
|
Comment thread
Copy link
Copy Markdown
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityAccording to the typeshed, the scheme argument to urlparse is Optional. However, with this change, a value of None will result in an error like: AttributeError: 'NoneType' object has no attribute 'replace' I'm not sure whether the typeshed is wrong or if this line should be guarded with if scheme is not None, but we should definitely fix one or the other and perhaps improve the documentation on this option. Thanks to @branchvincent for doing the digging and reporting this issue to me.
Sorry, something went wrong.
All reactions
|
||
|
|
||
| allow_fragments = bool(allow_fragments) | ||
| key = url, scheme, allow_fragments, type(url), type(scheme) | ||
| cached = _parse_cache.get(key, None) | ||
| Expand All | @@ -472,9 +477,6 @@ def urlsplit(url, scheme='', allow_fragments=True): | |
| else: | ||
| scheme, url = url[:i].lower(), url[i+1:] | ||
|
|
||
| for b in _UNSAFE_URL_BYTES_TO_REMOVE: | ||
| url = url.replace(b, "") | ||
|
|
||
| if url[:2] == '//': | ||
| netloc, url = _splitnetloc(url, 2) | ||
| if (('[' in netloc and ']' not in netloc) or | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.