Fix resolving of relative URL filenames (fixes Debian bug 748905)
commit8247703f8b290485ab0b2f031d1ac6e973fb265f
authorThomas Perl <m@thp.io>
Fri, 1 Aug 2014 19:45:21 +0000 (1 21:45 +0200)
committerThomas Perl <m@thp.io>
Fri, 1 Aug 2014 19:45:21 +0000 (1 21:45 +0200)
treed5ccb5477c99d4c432455142d655f29accc779d6
parent2d76cbb233d67b04fa1a90b8f6aa9d159621f0e8
Fix resolving of relative URL filenames (fixes Debian bug 748905)

urlwatch fails with exception if the URL filename doesn't include the /
character. So this works:

$ urlwatch --urls=./urls

But this, which should be equivalent, doesn't:

$ urlwatch --urls=urls
Traceback (most recent call last):
 File "/usr/bin/urlwatch", line 244, in <module>
   jobs = handler.parse_urls_txt(urls_txt)
 File "/usr/share/urlwatch/urlwatch/handler.py", line 155, in parse_urls_txt
   dir_st = os.stat(dirname)
OSError: [Errno 2] No such file or directory: ''

Thanks to Jakub Wilk for reporting this issue here:
https://bugs.debian.org/748905
lib/urlwatch/handler.py