Issue101

Project smart
Title Crash with smart search with none descriptions
Priority bug Status resolved
Superseder Nosy List n3npq, netmask
Assigned To Topics

Created on 2006-01-27.00:49:09 by Ben77, last changed 2006-01-29.18:44:56 by netmask.

Messages
msg299 (view) Author: netmask Date: 2006-01-29.18:44:56
This has been solved. Check issue64 and issue68.
msg297 (view) Author: n3npq Date: 2006-01-27.15:11:36
Try the same command in the C locale, perhaps there is a missing translation from 
the specspo package.
msg296 (view) Author: n3npq Date: 2006-01-27.14:55:52
On Jan 26, 2006, at 7:49 PM, Ben at Labix Tracker wrote:

>
> New submission from Ben <ben77@aol.com>:
>
> Currently if I do any search with smart it crashes with this error:
> 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
>
> Apparently the fc4 dhcdbd package has an empty description that is  
> translated
> into a None in smart. Therefore any search crashes it. I don't know  
> if this is
> really a packaging error, but a quick fix would be a check before  
> calling
> pattern.search. Simply change line 238 to:
> if info.getDescription() and pattern.search(info.getDescription()):
>

There is something else wrong, since %description is a required/ 
mandatory field in all
*.rpm packages.

73 de Jeff
msg295 (view) Author: Ben77 Date: 2006-01-27.00:49:07
Currently if I do any search with smart it crashes with this error:
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

Apparently the fc4 dhcdbd package has an empty description that is translated
into a None in smart. Therefore any search crashes it. I don't know if this is
really a packaging error, but a quick fix would be a check before calling
pattern.search. Simply change line 238 to:
if info.getDescription() and pattern.search(info.getDescription()):
History
Date User Action Args
2006-01-29 18:44:59netmasksetstatus: chatting -> resolved
nosy: + netmask
messages: + msg299
2006-01-27 20:40:23Ben77setnosy: - Ben77
2006-01-27 15:11:37n3npqsetmessages: + msg297
2006-01-27 14:55:52n3npqsetstatus: unread -> chatting
nosy: + n3npq
messages: + msg296
2006-01-27 00:49:20Ben77create