Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Closes #6015
|
|
Python 3.6 gets some of those "wrong":
https://bugs.python.org/issue1043134
This has been fixed in Python 3.7:
https://github.com/python/cpython/pull/14375
The override dict has been generated by copying the types_map from the
current git master:
https://github.com/python/cpython/blob/v3.10.0a3/Lib/mimetypes.py#L414-L547
And then running the following with Python 3.6:
import mimetypes
reverse = {}
for ext, mimetype in types_map.items():
if mimetype not in reverse:
reverse[mimetype] = ext
assert reverse['text/plain'] == '.txt'
for mimetype, ext in reverse.items():
got = mimetypes.guess_extension(mimetype)
if got != ext:
print(f' "{mimetype}": "{ext}", # not {got}')
|
|
Argh. I should've known Python can do this, but I didn't notice (or
forget?) and wrote code - some 140 lines of it - which only was in this
repository for a couple of hours.
Oh well, good riddance, code which was replaced by a simple
"mimetypes.guess_type(url.toString())". May you be resurrected if we
ever need a proper data: URL parser at a later point.
I guess some lessons have to be learned the hard way...
|
|
|
|
This makes the callers a bit simpler because they don't need to take
care of falling back themselves.
|
|
|
|
See #5892
|
|
|
|
|
|
|
|
See #5396
|
|
|
|
The previous approach converted "javascript:///" to "/" as Qt only sets
an internal "hasAuthority" flag, but we can't actually know whether
an (empty) authority is present or not.
However, QUrl doesn't let us get a FullyDecoded string because the value
could be ambiguous - instead, we get the FullyEncoded variant now, and
decode it via Python's urllib.parse.
This seems to fix the /// corner case, and also is much closer to the
standard.
|
|
See #221
|
|
|
|
* this catches the edge case of urlstr w/ valid schemes, but
contain space(s), such urlstr should be treated as non-URLs
* e.g. "site:cookies.com oatmeal raisin" should be auto-searched
|
|
* no-url-scheme -> schemeless
* improve message to log.url.debug
|
|
* when `url.auto_search = 'no-url-scheme'`, URLs
must contain schemes to be considered valid
* implements feature requested in #5038
|
|
See #5368
|
|
See #5368
|
|
See #5368 and https://bugreports.qt.io/browse/PYSIDE-1248
|
|
See #5368
|
|
|
|
|
|
In the search engine url replacement, only quote the search term if the
search engine format explicitly requests this:
- The placeholder {} quotes all characters except '/' like before of
#4434. This seems to be the default for other browsers' search
engines and to be supported by most websites. For example,
https://en.wikipedia.org/wiki/AC/DC leads to the wikipedia article
of AC/DC.
- New placeholders allow to specify how the search term shall be
quoted: {unquoted} inserts the plain search term, {semiquoted}
behaves like {} and {quoted} inserts the quoted search term. For
example, with
c.url.searchengines['jpc'] = 'https://www.jpc.de/s/{quoted}'
the command "jpc AC/DC" redirects to https://www.jpc.de/s/AC%2FDC
given results for "AC/DC". Here, the placeholder {quoted} is indeed
necessary (as of March 2020), since https://www.jpc.de/s/AC/DC only
searches for "AC".
This addresses the issue #1772 and partially reverts #4434 (making the
there introduced behaviour configurable).
|
|
|
|
|
|
This avoids various circular imports such as:
urlutils -> config -> configdata -> configtypes -> configexc -> jinja ->
urlutils
or:
configutils -> urlutils -> config -> configutils
|
|
Fixes #5125.
|
|
|
|
See #5056
|
|
See #5056
|
|
|
|
|
|
Fixes #970.
|
|
Fixes #5072. Also fixes url.open_base_url with url.auto_search=never.
|
|
|
|
|
|
|
|
|
|
Fixes #2429.
|
|
See #5038.
|
|
|
|
|
|
|
|
See #4917, #4795
|
|
|