[issue341] 'TypeError: coercing to Unicode' on smart update

Ed Avis at Labix Tracker tracker at labix.org
Thu Nov 15 07:15:27 PST 2007


New submission from Ed Avis <ed at membled.com>:

When running 'smart update' I saw this error:

Loading cache...
Updating cache...               ######################################## [100%]

                                                                               
Fetching information for 'Fedora 8 - i386'...
                                                                               
-> http://download.fedora.redhat.com/pub/fedora/linux/releases/8/.../rep
-> omd.xml
repomd.xml                      ######################################## [ 16%]
Traceback (most recent call last):
  File "/usr/bin/smart", line 194, in <module>
    main(sys.argv[1:])
  File "/usr/bin/smart", line 167, in main
    exitcode = iface.run(opts.command, opts.argv)
  File "/usr/lib/python2.5/site-packages/smart/interface.py", line 53, in run
    result = _command.main(self._ctrl, opts)
  File "/usr/lib/python2.5/site-packages/smart/commands/update.py", line 78, in main
    failed = not ctrl.reloadChannels(channels, caching=NEVER)
  File "/usr/lib/python2.5/site-packages/smart/control.py", line 352, in
reloadChannels
    if not channel.fetch(self._fetcher, progress):
  File "/usr/lib/python2.5/site-packages/smart/channels/rpm_md.py", line 73, in
fetch
    digest = getFileDigest(item.getTargetPath())
  File "/usr/lib/python2.5/site-packages/smart/util/filetools.py", line 31, in
getFileDigest
    file = open(path)
TypeError: coercing to Unicode: need string or buffer, NoneType found Unhandled
exception in thread started by Error in sys.excepthook:

Original exception was:


This error appeared running smart from cron, but does not appear running it at
the console.  A quick look at the code suggests a fix in rpm_md.py around line
73, change to

tp = item.getTargetPath()
if not tp:
  raise Error, "getTargetPath() returned None"
digest = getFileDigest(tp)

but this is only a guess.

----------
messages: 1239
nosy: ed
priority: bug
project: smart
status: unread
title: 'TypeError: coercing to Unicode' on smart update

_______________________________________
Labix issue tracker <tracker at labix.org>
<http://tracker.labix.org/issue341>
_______________________________________



More information about the Smart mailing list