X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=bin%2Fdecode-URLs.py;h=ef04664342a87b7a5d5dc1c65045aa3399aee77d;hb=refs%2Fheads%2Fmaster;hp=70400abb29df900a8c3adc3bbd8475340cf25493;hpb=f46bd4d41cc7f243bc8a321effee5200aa69e709;p=dotfiles.git diff --git a/bin/decode-URLs.py b/bin/decode-URLs.py index 70400ab..6b98bb3 100755 --- a/bin/decode-URLs.py +++ b/bin/decode-URLs.py @@ -1,12 +1,13 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 -import sys, urllib +from urllib.parse 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)