py23 urlib compat

unquote was move dto a diferent location
This commit is contained in:
MirceaDan committed 2018-12-01 22:44:01 -08:00
1 parent f72f948744
commit 6cfbdc6062
1 file changed
+4 -1
+4 -1
View File
@@ -508,7 +508,10 @@ def _extended_header_value(value):
if value.lower().startswith("iso-8859-1'") or value.lower().startswith("utf-8'"):
# RFC 5987 section 3.2
from urllib import unquote
try:
from urllib import unquote
except ImportError:
from urllib.parse import unquote
encoding, _, value = value.split("'", 2)
return unquote(octoprint.util.to_str(value, encoding="iso-8859-1")).decode(encoding)