Crashes when git isn't present
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslosphinx |
Fix Released
|
High
|
Doug Hellmann |
Bug Description
oslosphinx tries to be smart has has the below code:
def _guess_cgit_link():
try:
git_remote = subprocess.
['git', 'config', '--local', '--get', 'remote.
)
except subprocess.
return None
else:
parsed = parse.urlparse(
return CGIT_BASE + parsed.
Unfortunately, when building a package which uses oslosphinx, the exception isn't caught at all, and it crashes the build. For example, when trying to build olso.i18n, here's the result:
Traceback (most recent call last):
File "/usr/lib/
opts.
File "/usr/lib/
self.
File "/usr/lib/
ext_meta = mod.setup(self)
File "/usr/lib/
cgit_link = _guess_cgit_link()
File "/usr/lib/
['git', 'config', '--local', '--get', 'remote.
File "/usr/lib/
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/
errread, errwrite)
File "/usr/lib/
raise child_exception
OSError: [Errno 2] No such file or directory
Replacing "except subprocess.
Note that when building packages using sbuild for distributions, git isn't present indeed, so catching the exception is really what should be done, but properly.
Changed in oslosphinx: | |
assignee: | nobody → Doug Hellmann (doug-hellmann) |
importance: | Undecided → High |
Changed in oslosphinx: | |
milestone: | none → 4.1.0 |
status: | Fix Committed → Fix Released |
Fix proposed to branch: master /review. openstack. org/251955
Review: https:/