Issue64

Project smart
Title [PATCH] Fixed query with empty description/summary
Priority bug Status resolved
Superseder Nosy List ensc, netmask, niemeyer, thimm
Assigned To Topics

Created on 2005-12-26.12:08:44 by ensc, last changed 2006-04-17.00:55:14 by netmask.

Files
File name Uploaded Type Edit Remove
0002-Fixed-query-with-empty-description-summary.patch ensc, 2005-12-26.12:08:44 text/x-patch
Messages
msg458 (view) Author: netmask Date: 2006-04-17.00:55:13
msg451: point noted, we'll be discussing a better way of doing it.
msg451 (view) Author: thimm Date: 2006-03-31.19:40:51
Just a note on procedure: Should something fixed in svn only get into Status
"resolved"? If someone is browsing through the issues list to check for any
issues on the actual last release he will miss patches like these.
msg404 (view) Author: netmask Date: 2006-02-20.15:59:03
NOTE: the patch provided here is NOT the correction applied on the code. If
anyone wants that, you should checkout a diff from r689 to r690 from SVN trunk.
msg288 (view) Author: niemeyer Date: 2006-01-24.18:44:37
Fixed in revision 690. Summaries and descriptions should never be None. It was a
bug in the metadata loader.

Thanks for exploring the problem guys.
msg186 (view) Author: ensc Date: 2005-12-26.14:06:44
The 'None' case happens for every rpm-package which has an empty description. E.g.

http://download.fedora.redhat.com/pub/fedora/linux/extras/4/i386/python-psyco-1.5-2.fc4.i386.rpm
msg184 (view) Author: netmask Date: 2005-12-26.13:53:17
Although it is some sort of fix, I don't agree it's the best.

IMHO, the correct behavior is that the channel loader should return an empty
string ("", not None) if there is no description for the package. So we should
check the erroneous behavior on the channel loader.

What kind of channels are you using?

Another approach would be:

data = (info.getSummary() or "")

It would be a smaller change, and would result on the same effect (empty string
when info.getSummary returns None, which is erroneous, as I said before).

I think Niemeyer is the right person to abitrate on that issue.
msg183 (view) Author: ensc Date: 2005-12-26.12:08:44
Fixes

| Traceback (most recent call last):
|   File "/usr/bin/smart", line 194, in ?
|     main(sys.argv[1:])
|   File "/usr/bin/smart", line 167, in main
|     exitcode = iface.run(opts.command, opts.argv)
|   File "/usr/lib/python2.4/site-packages/smart/interface.py", line 53, in run
|     result = _command.main(self._ctrl, opts)
|   File "/usr/lib/python2.4/site-packages/smart/commands/query.py", line 283,
in main
|     if pattern.search(info.getDescription()):
| TypeError: expected string or buffer

which happens when a package has an empty %description. Ditto for summary.
History
Date User Action Args
2006-04-17 00:55:15netmasksetstatus: chatting -> resolved
messages: + msg458
2006-03-31 19:40:52thimmsetstatus: resolved -> chatting
nosy: + thimm
messages: + msg451
2006-03-19 11:18:51netmasklinkissue131 superseder
2006-02-22 02:04:29netmasklinkissue126 superseder
2006-02-20 15:59:27netmasksetstatus: chatting -> resolved
2006-02-20 15:59:05netmasksetstatus: resolved -> chatting
nosy: ensc, niemeyer, netmask
messages: + msg404
2006-01-24 18:44:38niemeyersetstatus: chatting -> resolved
nosy: + niemeyer
messages: + msg288
2006-01-05 23:44:06netmasklinkissue68 superseder
2005-12-26 14:06:44enscsetnosy: ensc, netmask
messages: + msg186
2005-12-26 13:53:18netmasksetstatus: unread -> chatting
nosy: + netmask
messages: + msg184
2005-12-26 12:08:46ensccreate