-#! /usr/bin/env python
+#! /usr/bin/env python3
-import sys, urllib
+try:
+ from urllib.parse import unquote
+except ImportError:
+ from urllib import unquote
+import sys
while True:
url = sys.stdin.readline()
if not url:
break
- unqoted = urllib.unquote(url.strip())
+ unqoted = unquote(url.strip())
if unqoted.startswith('file://'):
unqoted = unqoted[len('file://'):]
- print unqoted
+ print(unqoted)