Package: python-qt4
Version: 4.3-7

Hello,

There is a bug in python-qt4 which causes software-properties-kde
to crash in Turkish locale (tr_TR.UTF-8). This bug is already
fixed in (K)Ubuntu. Please see

https://bugs.launchpad.net/ubuntu/+source/python-qt4/+bug/97420

for more information.

Here's a summary of the bug:

When one tries to start software-properties-kde, it fails
with the following output:

/usr/lib/python2.4/site-packages/apt/__init__.py:18: FutureWarning: apt API not 
stable yet
  warnings.warn("apt API not stable yet", FutureWarning)
Traceback (most recent call last):
  File "/usr/bin/software-properties-kde", line 92, in ?
    app = SoftwarePropertiesKDE(datadir=data_dir, options=options, file=file)
  File 
"/var/lib/python-support/python2.4/softwareproperties/kde/SoftwarePropertiesKDE.py",
 line
66, in __init__
    self.userinterface = SoftwarePropertiesKDEUI(datadir)
  File 
"/var/lib/python-support/python2.4/softwareproperties/kde/SoftwarePropertiesKDE.py",
 line
52, in __init__
    uic.loadUi("%s/designer/main.ui" % datadir, self)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/__init__.py", line 93, in 
loadUi
    return loader.DynamicUILoader().loadUi(uifile, baseinstance)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/Loader/loader.py", line 25, 
in loadUi
    return self.parse(filename)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 553, in 
parse
    actor(elem)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 412, in 
createUserInterface
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 390, in 
traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 285, in 
createLayout
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 390, in 
traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 293, in 
handleItem
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 390, in 
traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 160, in 
createWidget
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 390, in 
traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 160, in 
createWidget
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 390, in 
traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 285, in 
createLayout
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 390, in 
traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 293, in 
handleItem
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 390, in 
traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 160, in 
createWidget
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 390, in 
traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 285, in 
createLayout
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 390, in 
traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 293, in 
handleItem
    self.traverseWidgetTree(elem)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 390, in 
traverseWidgetTree
    handler(self, child)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 153, in 
createWidget
    self.stack.push(self.setupObject(widgetClass(elem), parent, elem))
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/uiparser.py", line 129, in 
setupObject
    self.wprops.setProperties(obj, branch)
  File "/usr/lib/python2.4/site-packages/PyQt4/uic/properties.py", line 220, in 
setProperties
    getattr(widget, "set%s%s" % (propname[0].upper(), propname[1:]))(
AttributeError: setindentation


The reason is the following lines in
"/usr/lib/python2.4/site-packages/PyQt4/uic/properties.py" (which in
turn is a symbolic link to:
"/usr/share/pycentral/python-qt4/site-packages/PyQt4/uic/properties.py")

186                  getattr(self, propname)(widget, prop)
187              else:
188                  getattr(widget, "set%s%s" % (propname[0].upper(), 
propname[1:]))(
189                      self.convert(prop, widget))
190

Notice the use of .upper() on line 188. This is what 
causes the crash. When one encounters a propname
whose first letter is 'i' (such as "indentation"),
because of the Turkish locale, that doesn't get
converted into regular English capital 'i'. It instead
gets converted to the Turkish capital 'i' with a dot
on top: Idotabove. Because for some reason python cannot
handle a Turkish capital 'i', software-properties-kde crashes.

I am attaching a patch which corrects the usage of
.upper() in the two instances in the mentioned
file.

Thank you for your attention,

situert




      
____________________________________________________________________________________
Check out the hottest 2008 models today at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html
--- properties.py.original	2007-09-24 00:00:00.000000000 +0000
+++ properties.py	2007-10-03 00:00:00.000000000 +0000
@@ -185,14 +185,25 @@
             if hasattr(self, propname):
                 getattr(self, propname)(widget, prop)
             else:
-                getattr(widget, "set%s%s" % (propname[0].upper(), propname[1:]))(
+		#print(propname);
+		capital_letter=''
+		if propname[0] is 'i':
+			capital_letter='I';
+		else:
+			capital_letter=propname[0].upper();
+                getattr(widget, "set%s%s" % (capital_letter, propname[1:]))(
                     self.convert(prop, widget))
 
     # delayed properties will be set after the whole widget tree has been populated
     def _delay(self, widget, prop):
         propname = prop.attrib["name"]
+	capital_letter=''
+	if propname[0] is 'i':
+		capital_letter='I';
+	else:
+		capital_letter=propname[0].upper();
         self.delayed_props.append(
-            (getattr(widget, "set%s%s" % (propname[0].upper(), propname[1:])),
+            (getattr(widget, "set%s%s" % (capital_letter, propname[1:])),
                                   self.convert(prop)))
 
     # this properties will be set with a widget.setProperty call rather than

Reply via email to