From 99d00a7fc66be88db371691517494098199d4426 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Jul 20 2016 21:25:57 +0000 Subject: Ensure the URLs are bytes not unicode before being .strip() --- diff --git a/hubs/widgets/library.py b/hubs/widgets/library.py index 2169f2f..5dd4f5a 100644 --- a/hubs/widgets/library.py +++ b/hubs/widgets/library.py @@ -17,9 +17,9 @@ position = 'both' "External links must include the whole link (starting with http...") def data(session, widget, urls): urls = [ - clean_input.clean('{0}'.format(u.strip())) + clean_input.clean('{0}'.format(u.encode('utf-8').strip())) for u in widget.config.get('urls', '').split(',') - if u.strip() + if u.encode('utf-8').strip() ] return dict(urls=urls)