bugs: smart on fc5

Darko Veberic darko.veberic at p-ng.si
Wed Apr 12 10:16:14 PDT 2006


Gustavo Niemeyer wrote:
>> no, the return from info.getDescription() is None in some cases... but 
>> you are right: maybe the info class should return an empty string.
> 
> It shouldn't be None, ever. If it's None in some cases, that's the
> bug that should be fixed. Following the path of how description gets
> there, I couldn't find a reason for it to be None. Can you please
> tell me what channel types you're using?

# smart channel --show
[dries]
type = rpm-md
name = dries
baseurl = 
http://ftp.belnet.be/packages/dries.ulyssis.org/fedora/linux/5/i386/dries/RPMS

[atrpms]
type = rpm-md
name = atrpms
baseurl = http://dl.atrpms.net/fc5-i386/atrpms/stable

[kde-rh.all]
type = apt-rpm
name = atrpms.kde-redhat.all
baseurl = http://kde-redhat.atrpms.net/apt/kde-redhat/all
components = stable

[redhat]
type = apt-rpm
name = atrpms.redhat
baseurl = http://dl.atrpms.net/fc5-i386/redhat
components = release updates extras

[kde-rh.fc5]
type = rpm-md
name = atrpms.kde-redhat.fc5
baseurl = http://kde-redhat.atrpms.net/apt/kde-redhat/fedora/5/i386/stable

[release]
type = rpm-md
name = fc5 release
baseurl = http://download.fedora.redhat.com/pub/fedora/linux/core/5/i386/os

[livna]
type = rpm-md
name = livna
baseurl = http://rpm.livna.org/fedora/5/i386

[updates]
type = rpm-md
name = fc5 updates
baseurl = 
http://download.fedora.redhat.com/pub/fedora/linux/core/updates/5/i386

[atrpms-y]
type = rpm-md
name = atrpms
baseurl = http://dl.atrpms.net/fc5-i386/atrpms/stable

[rpm-db]
type = rpm-sys
name = RPM Database

[freshrpms]
type = rpm-md
name = atrpms.freshrpms
baseurl = http://freshrpms.atrpms.net/fedora/linux/5/i386/freshrpms

[extras]
type = rpm-md
name = fc5 extras
baseurl = http://download.fedora.redhat.com/pub/fedora/linux/extras/5/i386


the unaltered "smart search gkrellm" does this:

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


"smart info" dies after some correct output with:

Name: mythnews
Version: 0.19-123.rhfc5.at at i386
Priority: 0
Group: Applications/Multimedia
Installed Size: 223.9kB
Reference URLs:
Flags:
Channels: atrpms
Summary: A RSS News Feed Plugin for MythTV.
Description:
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/info.py", line 
128, in main
     for line in info.getDescription().splitlines():
AttributeError: 'NoneType' object has no attribute 'splitlines'


>> well that is somehow awkward, don't you think? i have not seen any 
>> command-line programs that stop working if your terminal does not have 
>> some capability. without .encode() smart info just stops with an error. 
> (...)
> 
> Agreed. But in that case the error is somewhere else, and I'd be
> glad to have more information about it. We can't encode things to
> a fixed encoding. Just like you expect it to "just work", people
> using iso-8859-1 or whatever is used in their terminals expect
> the same thing as well.

fixing just the error above (info.py, line 128) "smart info" dies 
somewhat differently (again after some regular output):

Name: libsepol
Version: 1.12.1-1.fc5 at i386
Priority: 0
Group: System Environment/Libraries
Installed Size: 285.3kB
Reference URLs:
Flags:
Channels: atrpms.redhat; fc5 updates
Summary: SELinux binary policy manipulation library
Description:
  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/info.py", line 
134, in main
     print "", line
UnicodeEncodeError: 'ascii' codec can't encode character u'\xae' in 
position 49: ordinal not in range(128)


probably all the problems are coming from strange entries in the meta 
descriptions. but this is hard to prevent. smart should survive all the 
garbage packagers are putting in the rpms.

thanks for your effort! you are doing a really great job.

best,
-- 
darko.

Dr. Darko Veberic ------------------
Laboratory for Astroparticle Physics
University of Nova Gorica
Vipavska 13, POB 301
SI-5001 Nova Gorica, Slovenia
mobile: +386 41 860 861
  phone: +386 5 3315 255
    fax: +386 5 3315 240
------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: darko.veberic.vcf
Type: text/x-vcard
Size: 383 bytes
Desc: not available
URL: <http://lists.labix.org/pipermail/smart-labix.org/attachments/20060412/884b161b/attachment-0003.vcf>


More information about the Smart mailing list