Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Issue 767 - unicode description of InstallError #661

Merged
merged 1 commit into from Mar 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions handlers/pulp_rpm/handlers/rpmtools.py
Expand Up @@ -132,7 +132,8 @@ def install(self, names):
try:
yb.install(pattern=pattern)
except InstallError, caught:
caught.value = '%s: %s' % (pattern, str(caught))
description = unicode(caught).encode('utf-8')
caught.value = '%s: %s' % (pattern, description)
raise caught
yb.resolveDeps()
if self.apply and len(yb.tsInfo):
Expand Down Expand Up @@ -455,7 +456,7 @@ def __init__(self, report):
DownloadBaseCallback.__init__(self)
self.report = report

def _do_start( self, now=None):
def _do_start(self, now=None):
"""
Notification that a file download has started.
The event is forwarded to the report object to be consolidated
Expand Down
3 changes: 2 additions & 1 deletion handlers/test/unit/handlers/mock_yum.py
Expand Up @@ -122,7 +122,8 @@ def __init__(self, *args, **kwargs):

def install(self, pattern):
if YumBase.UNKNOWN_PKG in pattern:
raise InstallError('package not found')
name = u'D' + unichr(246) + 'g'
raise InstallError('package %s not found' % name)
pkg = Pkg(pattern, '1.0')
t = TxMember(constants.TS_INSTALL, self.REPOID, pkg)
self.tsInfo.append(t)
Expand Down