-
-
Notifications
You must be signed in to change notification settings - Fork 476
Browser fails to load urls containing certain types of characters (colon, %20, and possible more) #384
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
Comments
That # If it is C:\ then colon was encoded. Decode it back.
url = re.sub(r"^([a-zA-Z])%3A", r"\1:", url)
# Allow hash when loading urls. The pathname2url function
# replaced hashes with "%23" (Issue #114).
url = url.replace("%23", "#")
# Allow more special characters when loading urls. The pathname2url
# function encoded them and need to decode them back here
# Characters: ? & = (Issue #273).
url = url.replace("%3F", "?")
url = url.replace("%26", "&")
url = url.replace("%3D", "=") It seems that this list grows by time, The call to |
I'd say to recommend the use of pathlib.path.as_uri() in the createbrowser documentation and do the conversion in app-code. There are plenty of uri shemes and too many wrong assumptions that could be made. https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.as_uri Problem is of course, that pathlib is a python 3.4 module. earlier pythons would need to use pathname2url from urllib. |
I'm leaning to making this work with unicode characters out of the box, otherwise there will be issues with apps that are installed to %appdata% directory on Windows, since user name may contain unicode characters. Maybe write a function that will replace any Maybe modifying the path is not even required in latest CEF, I haven't tested how it behaves with unicode characters (chinese ones especially that were reported initially), there have been many changes in upstream since v31 and that GetNavigateUrl func was written long before v31. |
Related upstream CEF issue: Issue #2407 ("Cef Unable to open file with # symbol in file path name"). |
Updated Migration-Guide.md document and other documentation.
Fixed in commit 6cc7f9c. This breaks backwards compatibility and thus I've added required information to the Migration Guide document. @Berserker66 Thanks for the info. I've added info on both |
Traceback:
It seems that is causing the issue:
Ref:
cefpython/src/utils.pyx
Line 100 in dde0167
That urllib func is imported in cefpython.pyx
The text was updated successfully, but these errors were encountered: