Re: yum-3.1.7 TypeError bug

Christoph Thiel <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <[email protected]>
On Fri, May 04, 2007 at 10:08:11AM -0400, seth vidal wrote:
> On Fri, 2007-05-04 at 15:34 +0700, Fajar A. Nugraha wrote:
> > Fajar A. Nugraha wrote:
> > > Tim Lauridsen wrote:
> > >   
> > >> Hi.
> > >>
> > >> yum-utils 1.1.3 has been released.
> > >>
> > >>     
> > > ... And yum-priorities is WORKING again !!!
> > > Thanks :)
> > >
> > > Using yum-3.1.7, yum-utils-1.1.3
> > >
> > >   
> > But apparently an old yum-3.1 bug is back
> > 
> > # yum -d9 -y install yum-skip-broken yum-allowdowngrade
> > Loading "priorities" plugin
> > Running "config" handler for "priorities" plugin
> > Yum Version: 3.1.7
> > COMMAND: yum -d9 -y install yum-skip-broken yum-allowdowngrade
> > Installroot: /
> > Ext Commands:
> > 
> >    yum-skip-broken
> >    yum-allowdowngrade
> > Setting up Install Process
> > Parsing package install arguments
> > Setting up Package Sacks
> > 
> > <=== output truncated ====>
> > 
> > processing qtcurve-gtk2
> > processing neon
> >    yum-allowdowngrade.noarch 0:1.1.3-1.fan
> > Resolving Dependencies
> > 1178267444.44
> > --> Running transaction check
> > ---> Package yum-allowdowngrade.noarch 0:1.1.3-1.fan set to be updated
> > Checking deps for yum-allowdowngrade.noarch 0-1.1.3-1.fan - u
> > looking for (u'yum', u'GE', (u'0', u'3.1', None)) as a requirement of
> > yum-allowdowngrade.noarch 0-1.1.3-1.fan - u
> > Traceback (most recent call last):
> >   File "/usr/bin/yum", line 29, in <module>
> >     yummain.main(sys.argv[1:])
> >   File "/usr/share/yum-cli/yummain.py", line 135, in main
> >     (result, resultmsgs) = base.buildTransaction()
> >   File "/usr/lib/python2.5/site-packages/PIL/__init__.py", line 548, in
> > buildTransaction
> > 
> >   File "depsolve.py", line 794, in resolveDeps
> >   File "depsolve.py", line 773, in _mytsCheck
> >   File "depsolve.py", line 933, in _checkInstall
> >   File "depsolve.py", line 692, in _provideToPkg
> >   File "rpmsack.py", line 386, in whatProvides
> >   File "rpmsack.py", line 145, in searchProvides
> >   File "rpmsack.py", line 122, in searchPrco
> > TypeError: unknown key type
> 
> 
> 
> what version of rpm, rpm-python and which distro?
> thanks

Looks like the problem we were seeing on SUSE lately. Try attached patch to
work around it, until it's fixed in rpm-python.

(You should also apply the 2nd patch, yum-install.patch, to make sure you
get a sane trace. The PLI reference looks totally odd to me.)


Best,
Christoph
-- 
Christoph Thiel, Tech. Project Management, Research & Development
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)

_______________________________________________
Yum mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum
yum-3.1.7.patch (text/x-patch, 711 B)
--- yum/rpmsack.py
+++ yum/rpmsack.py
@@ -104,7 +104,7 @@
         ts = self.readOnlyTS()
         result = {}
         
-        mi = ts.dbMatch('basenames', name)
+        mi = ts.dbMatch('basenames', name.encode('us-ascii'))
         for hdr in mi:
             pkg = self._makePackageObject(hdr, mi.instance())
             if not result.has_key(pkg.pkgid):
@@ -119,7 +119,7 @@
         ts = self.readOnlyTS()
         result = {}
         tag = self.DEP_TABLE[prcotype][0]
-        mi = ts.dbMatch(tag, name)
+        mi = ts.dbMatch(tag, name.encode('us-ascii'))
         for hdr in mi:
             po = self._makePackageObject(hdr, mi.instance())
             prcotup = (name, None, (None, None, None))
yum-install.patch (text/x-patch, 692 B)
--- rpmUtils/Makefile
+++ rpmUtils/Makefile
@@ -17,4 +17,4 @@
 	for p in $(PYFILES) ; do \
 		install -m 644 $$p $(DESTDIR)/$(PKGDIR)/$$p; \
 	done
-	$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(PKGDIR)', 1, '$(PYDIR)', 1)"
+	$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(PKGDIR)', 1, '$(PKGDIR)', 1)"
--- yum/Makefile
+++ yum/Makefile
@@ -17,4 +17,4 @@
 	for p in $(PYFILES) ; do \
 		install -m 644 $$p $(DESTDIR)/$(PKGDIR)/$$p; \
 	done
-	$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(PKGDIR)', 1, '$(PYDIR)', 1)"
+	$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(PKGDIR)', 1, '$(PKGDIR)', 1)"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.