Strip trailing slashes from localname.

This commit is contained in:
Ethan Dalool 2018-09-30 01:45:38 -07:00
parent 09d9339efb
commit 9b8db0d8ef

View file

@ -346,6 +346,7 @@ def basename_from_url(url):
Determine the local filename appropriate for a URL. Determine the local filename appropriate for a URL.
''' '''
localname = urllib.parse.unquote(url) localname = urllib.parse.unquote(url)
localname = localname.rstrip('/')
localname = localname.split('?')[0] localname = localname.split('?')[0]
localname = localname.split('/')[-1] localname = localname.split('/')[-1]
return localname return localname