Red Hat Bugzilla – Bug 567887
repoclosure breaks with relative paths
Last modified: 2014-01-21 18:13:57 EST
abrt 1.0.6 detected a crash.
cmdline: /usr/bin/python -t /usr/bin/repoclosure --repofrompath myrepo,. -t -r myrepo
comment: I ran repoclosure with "." denoting current directory. Maybe it's a bad syntax, but it should not certainly trigger ABRT showing crash, it should just report an error in the shell.
release: Fedora release 12 (Constantine)
Summary: TB66407244 config.py:94:__set__:ValueError: Error parsing '.': URL must be http, ftp, file or https not ""
Traceback (most recent call last):
File "/usr/bin/repoclosure", line 276, in <module>
File "/usr/bin/repoclosure", line 206, in main
newrepo.baseurl = baseurl
File "/usr/lib/python2.6/site-packages/yum/config.py", line 94, in __set__
raise ValueError('Error parsing %r: %s' % (value, str(e)))
ValueError: Error parsing '.': URL must be http, ftp, file or https not ""
Local variables in innermost frame:
obj: <yum.yumRepo.YumRepository object at 0x1308e90>
self: <yum.config.UrlListOption object at 0xf2a9d0>
e: ValueError('URL must be http, ftp, file or https not ""',)
How to reproduce
1. $ repoclosure --repofrompath myrepo,. -t -r myrepo
Created attachment 395955 [details]
specify repoid & paths of additional repositories -
unique repoid and complete path required, can be
specified multiple times. Example.
You need to use the full path to the repo
Yeah, I know now. The funny thing is that now that ABRT is widely deployed, Python developers will receive quite a lot automated bug reports if they keep not catching exceptions. I am just beginner in Python, but I also use tracebacks as an error output quite often. It's easier than to catch the exception and end the program anyway, and still it's readable. But it seems it will be necessary to catch all those exception for which you don't want to receive bug reports.
Just a thought, I'm not an expert in this.
committed a change to catch these errors and tested it w/the above.
you're right, abrt will cause us more irritation and this is an easy catch.
And i have fixed repoclosure to work with relative paths, really easy to fix :)