Gutsy: radio buttons in kde-systemsettings' "Disk & Filesystems" module are broken

Bug #141023 reported by archdrone
4
Affects Status Importance Assigned to Milestone
kde-guidance (Ubuntu)
Fix Released
Medium
Luka Renko

Bug Description

Binary package hint: kde-systemsettings

1. run `systemsettings`
2. go to "Advanced" tab
3. open "Disk & Filesystems" module
4. click "New" (you must have admin rights to do that)
5. click on radio buttons "by UUID" and/or "by label", these buttons behave like check-boxes and text-boxes next to them are grey ...
(those radio buttons also behave strange in "Change" dialog)
2.6.22-11-generic #1 SMP Mon Sep 17 03:45:58 GMT 2007 i686 GNU/Linux

Related branches

Revision history for this message
Liam Keene (liam-keene) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Can you provide more information about the version of Ubuntu (I'm assuming Gutsy from your kernel version) and SystemSettings you are running?

For me, in v0.2 (Ubuntu package version 0.0svn20070312-0ubuntu3) the radio buttons are behaving correctly.

Changed in kde-systemsettings:
status: New → Incomplete
Revision history for this message
Liam Keene (liam-keene) wrote :
Revision history for this message
archdrone (archdrone) wrote :

Gutsy 7.10
kde-systemsettings ... 0.0svn20070312-0ubuntu3 (same as yours, weird)
required dependencies:
kdelibs4c2a ... 3.5.7-ubuntu14
libc6 ... 2.6.1-1ubuntu5
libgcc1 ... 4.2.1-5ubuntu3
libqt3-mt ... 3.3.8really3.3.7-0ubuntu10
libstdc++6 ... 4.2.1-5ubuntu3
kcontrol ... 3.5.7-1ubuntu23

Revision history for this message
Liam Keene (liam-keene) wrote :

I was having a deeper look into this, and it turns out that System Settings is basically KControl but re-organised, which in turn is jsut a collection of individual applications, nicely grouped.

The application responsible for Disks & Filesystems is called 'mountconfig' and is installed in the kde-guidance package. The version I have installed is 0.8.0svn20070727-0ubuntu6.

I don't know if this is getting any closer.

Revision history for this message
archdrone (archdrone) wrote :

I have the same version of kde-guidance because I update often.
Now the strange part:
When I run `sudo mountconfig` module opens but the radio buttons in "New" dialog work fine.
So I have tried to run 'systemsetting' form console (`sudo systemsettings`) to see stderr output and voila (after chosing the radio button, output of stderr):

Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/mountconfig.py", line 1834, in slotUUIDCheckboxClicked
    label = microhal.getUUIDByDevice(str(self.devicelineedit.text()))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/apport_python_hook.py", line 42, in apport_excepthook
    binary = os.path.realpath(os.path.join(os.getcwdu(), sys.argv[0]))
AttributeError: 'module' object has no attribute 'argv'

Original exception was:
Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/mountconfig.py", line 1834, in slotUUIDCheckboxClicked
    label = microhal.getUUIDByDevice(str(self.devicelineedit.text()))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)

I am not familiar with python much but I think an expirienced python programmer could fix it within a minute:)

Revision history for this message
archdrone (archdrone) wrote :

Evidently the error appears only in internationalised versions of mountconfig (module called by my systemsettings is in Czech and has the error, module called directly from console is in English and works fine).
original:
    def slotUUIDCheckboxClicked(self):
        if self.uuidlineedit.text() == "":
            label = microhal.getUUIDByDevice(str(self.devicelineedit.text()))
            self.uuidlineedit.setText(label)
        self.devicecheckbox.setChecked(False)
        self.devicelineedit.setEnabled(False)
        self.labelcheckbox.setChecked(False)
        self.labellineedit.setEnabled(False)
        self.uuidlineedit.setEnabled(True)

dirty workaround (set the states of text/checkboxes before the crash could occur) :

    def slotUUIDCheckboxClicked(self):
        self.devicecheckbox.setChecked(False)
        self.devicelineedit.setEnabled(False)
        self.labelcheckbox.setChecked(False)
        self.labellineedit.setEnabled(False)
        self.uuidlineedit.setEnabled(True)
        if self.uuidlineedit.text() == "":
            label = microhal.getUUIDByDevice(str(self.devicelineedit.text()))
            self.uuidlineedit.setText(label)

and likewise for the label slot

Works OK on my machine.

Revision history for this message
archdrone (archdrone) wrote :

sorry wrong patch
this new one applied on /var/lib/python-support/python2.5/mountconfig.py solves my problem

Revision history for this message
Liam Keene (liam-keene) wrote :

I'm glad you looked into this a bit harder, I couldn't see the problem at first, until I realised you were using the application in Czech.

The problem is that when the radio buttons are clicked, the device name converted using the str function not the unicode function.

Hopefully this patch will fix this, so you can use unicode in the device name.

Changed in kde-systemsettings:
assignee: nobody → liam-keene
status: Incomplete → Confirmed
Revision history for this message
Liam Keene (liam-keene) wrote :
Changed in kde-guidance:
assignee: liam-keene → nobody
Revision history for this message
archdrone (archdrone) wrote :

kde-guidance 0.8.0svn20070928-0ubuntu2, Gutsy
The problem with radio buttons still not fixed (only in Czech locale), now the stderr is:

Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/mountconfig.py", line 1834, in slotUUIDCheckboxClicked
    label = microhal.getUUIDByDevice(str(self.devicelineedit.text()))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)
Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/mountconfig.py", line 1844, in slotLabelCheckboxClicked
    label = microhal.getLabelByDevice(str(self.devicelineedit.text()))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-4: ordinal not in range(128)
Error in sys.excepthook:
Traceback (most recent call last):
  File "/var/lib/python-support/python2.5/apport_python_hook.py", line 42, in apport_excepthook
    binary = os.path.realpath(os.path.join(os.getcwdu(), sys.argv[0]))
AttributeError: 'module' object has no attribute 'argv'

This problem only appears when there are national characters (filled in advance) in "Mount Point" or "by name" text box e.g. "<bod připojení>" instead of English "<mount point>".

Revision history for this message
Liam Keene (liam-keene) wrote :

Quoting archdrone
...

   label = microhal.getUUIDByDevice(str(self.devicelineedit.text()))

...

You need to apply the patch I submitted (comment before your last). It replaces the use of the Python function str (which uses ASCII) with the funciton unicode (which can handle unicode characters). The patch hasn't been incorporated into the latest version of the package, which is why it isn't working yet.

Revision history for this message
archdrone (archdrone) wrote :

My fault, I've changed the 'str' functions to 'unicode' ones and everything is perfect:) thx

Revision history for this message
Luka Renko (lure) wrote :

Liam, thanks for your patch. I have committed the fix into KDE svn:
SVN revision: 723452

I will try to prepare updated package for Kubuntu Gutsy (if I get exception for uploading fix before release).

Changed in kde-guidance:
assignee: nobody → lure
importance: Undecided → Medium
status: Confirmed → Fix Committed
Revision history for this message
Luka Renko (lure) wrote :

kde-guidance (0.8.0svn20070928-0ubuntu6) gutsy; urgency=low

  [ Jonathan Riddell ] * Add kubuntu_05_displayconfig_fix.diff with
  fix from Sebastian Heinline for bug which resulted in falsely
  restart X requests.

  [ Luka Renko ]
  * Disk & Filesystems does not work on non-English/unicode systems.
    Patch provided by Liam Keene. (LP: #141023)
    debian/patches/kubuntu_04_disk_unicode.diff
  * Install Xsession startup script (displayconfig-restore) in
    kde-guidance package as it is KDE specific. (LP: #146730)

 -- Luka Renko <email address hidden> Tue, 09 Oct 2007 19:57:37 +0200

Changed in kde-guidance:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.