mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
Revert "Deal with Internationalized Domain Name in URI"
This reverts commit a68af5f199
.
Patch does not fix the issue on my machine, so reverting for now.
This commit is contained in:
parent
6e4a546f7b
commit
80e45fee85
1 changed files with 0 additions and 8 deletions
|
@ -7,8 +7,6 @@ import urllib2
|
||||||
import ctypes
|
import ctypes
|
||||||
import urllib
|
import urllib
|
||||||
|
|
||||||
from urlparse import urlparse, urlunparse
|
|
||||||
|
|
||||||
from anki.lang import _
|
from anki.lang import _
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
from anki.utils import stripHTML, isWin, isMac, namedtmp, json, stripHTMLMedia
|
from anki.utils import stripHTML, isWin, isMac, namedtmp, json, stripHTMLMedia
|
||||||
|
@ -839,12 +837,6 @@ to a cloze type first, via Edit>Change Note Type."""))
|
||||||
self.mw.progress.start(
|
self.mw.progress.start(
|
||||||
immediate=True, parent=self.parentWindow)
|
immediate=True, parent=self.parentWindow)
|
||||||
try:
|
try:
|
||||||
# urllib2 doesn't work properly with IRI
|
|
||||||
# The following code translates IRI to standard URI
|
|
||||||
scheme, netloc, path, params, query, fragment = urlparse(url)
|
|
||||||
idna_netloc = urllib2.unquote(netloc.encode("ascii")).decode("utf-8").encode("idna")
|
|
||||||
url = urlunparse([scheme, idna_netloc, path, params, query, fragment])
|
|
||||||
|
|
||||||
req = urllib2.Request(url, None, {
|
req = urllib2.Request(url, None, {
|
||||||
'User-Agent': 'Mozilla/5.0 (compatible; Anki)'})
|
'User-Agent': 'Mozilla/5.0 (compatible; Anki)'})
|
||||||
filecontents = urllib2.urlopen(req).read()
|
filecontents = urllib2.urlopen(req).read()
|
||||||
|
|
Loading…
Reference in a new issue