Bug 740256

Summary: [abrt] wicd-gtk-1.7.0-9.fc15: guiutil.py:147:set_text:TypeError: Gtk.Entry.set_text() argument 1 must be string, not dbus.Boolean
Product: [Fedora] Fedora Reporter: alain.thiaville
Component: wicdAssignee: David Cantrell <dcantrell>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: dcantrell
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:85032f634b2e83271a316d47900336b85324800d
Fixed In Version: wicd-1.7.0-13.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-10 14:33:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description alain.thiaville 2011-09-21 13:14:29 UTC
abrt version: 2.0.3
architecture:   i686
cmdline:        /usr/bin/python -O /usr/share/wicd/gtk/wicd-client.py
component:      wicd
executable:     /usr/share/wicd/gtk/wicd-client.py
kernel:         2.6.40.3-0.fc15.i686
os_release:     Fedora release 15 (Lovelock)
package:        wicd-gtk-1.7.0-9.fc15
reason:         guiutil.py:147:set_text:TypeError: Gtk.Entry.set_text() argument 1 must be string, not dbus.Boolean
time:           Wed Sep 21 09:22:18 2011
uid:            500
username:       ath

backtrace:
:guiutil.py:147:set_text:TypeError: Gtk.Entry.set_text() argument 1 must be string, not dbus.Boolean
:
:Traceback (most recent call last):
:  File "/usr/share/wicd/gtk/gui.py", line 654, in edit_advanced
:    dialog.set_values()
:  File "/usr/share/wicd/gtk/netentry.py", line 335, in set_values
:    self.txt_dhcp_hostname.set_text(dhcphname)
:  File "/usr/share/wicd/gtk/guiutil.py", line 147, in set_text
:    self.entry.set_text(text)
:TypeError: Gtk.Entry.set_text() argument 1 must be string, not dbus.Boolean
:
:Local variables in innermost frame:
:text: dbus.Boolean(False)
:self: <LabelEntry object at 0x9adb98c (GtkHBox at 0x9be88c8)>

comment:
:1)reproductible systématiquement avec:
:[ath@mobilix ~]$ /usr/bin/python -O /usr/share/wicd/gtk/wicd-client.py
:2) traces:
:Traceback (most recent call last):
:  File "/usr/share/wicd/gtk/gui.py", line 654, in edit_advanced
:    dialog.set_values()
:  File "/usr/share/wicd/gtk/netentry.py", line 335, in set_values
:    self.txt_dhcp_hostname.set_text(dhcphname)
:  File "/usr/share/wicd/gtk/guiutil.py", line 147, in set_text
:    self.entry.set_text(text)
:TypeError: Gtk.Entry.set_text() argument 1 must be string, not dbus.Boolean
:
:3) comment reproduire
:  popup "wicd network manager"
:  champ network  "Wired Network", booléen "Use as defaut profile": NON COCHE
:  action: appui sur le bouton "properties"
:

Comment 1 David Cantrell 2012-02-14 13:53:43 UTC
Is this still happening on Fedora 16 with the latest wicd update?

Comment 2 alain.thiaville 2012-02-15 13:00:38 UTC
as far I can say, it's corrected in Fedora 16 with wicd-gtk-1.7.0-9.fc16.noarch

Comment 3 alain.thiaville 2012-03-01 10:05:28 UTC
I confirm the correction of this bug with  wicd-gtk-1.7.0-10.fc16.noarch ... But ...


The same kind of problem is now "one call before" in the function "add_profile" 
 file "/usr/share/wicd/gtk/netentry.py" 
 code extract:
722     def add_profile(self, widget):
 723         """ Add a profile to the profile list. """
 724         response = string_input("Enter a profile name", "The profile name " +
 725                                   "will not be used by the computer. It " +
 726                                   "allows you to " +
 727                                   "easily distinguish between different network " +
 728                                   "profiles.", "Profile name:").strip()
 729 
 730         # if response is "" or None
 731         if not response:
 732             error(None, "Invalid profile name", block=True)
 733             return False

an exception "NoneType has no method strip" will occur at line "728" each time a user press the "Cancel Buttom" or enter 'None python string'.
The guilty is of course, ... :input_string() because it's complete name is
"input_string_but_returns_TheString_or_None" ... Hereafter, the patch I made
in  /usr/share/wicd/gtk/guiutil.py

109 # ath 20120220 : always return a string : '' by default <=> No Entry or OK_Cancel press */
110     text = ''
111     if dialog.run() == gtk.RESPONSE_OK:
112 # ath 20120220 and ... strip it
113         text = entry.get_text().strip()
114 # ath  20120220        dialog.destroy()
115 # ath  20120220        return text
116 # ath  20120220    else:
117     dialog.destroy()
118     return text
119 

in place of:
109     if dialog.run() == gtk.RESPONSE_OK:
110         text = entry.get_text()
111         dialog.destroy()
112         return text
113     else:
114         dialog.destroy()
115         return None

with this patch, you have also to remove the now redundant strip() in add_profile(), after the string_input() call because it is useless.

P.S  Sorry, for my verbosity, but in french I am very more concise
 and as we say in french: Ouf !!! (<=>  mon laius est enfin terminé)

Comment 4 alain.thiaville 2012-03-01 12:16:15 UTC
A short review of "my wicd reported problems" the proposed patch in comments 3
would resolve   "https://bugzilla.redhat.com/show_bug.cgi?id=740309" i.e 740309
the "740317 Description field" last lines are: .
from bug https://bugzilla.redhat.com/show_bug.cgi?id=740309
:Traceback (most recent call last):
:  File "/usr/share/wicd/gtk/netentry.py", line 728, in add_profile
:    "profiles.", "Profile name:").strip()
:AttributeError: 'NoneType' object has no attribute 'strip'

in summary at now :
   this bug is closed
   740309: not closed but can be closed with "patch comments 3 of this"
   740309: "Comment #2" opens a new bug, not corrected by the patch. The new one
   isn't directly or indirectly bound to the first. It's just the same syndrom

Comment 5 David Cantrell 2012-03-26 19:31:06 UTC
Can you please attach your proposed patches as unified diffs (diff -u)?  I want to make sure I am getting everything you are proposing and it is difficult to follow in Bugzilla comments.

Comment 6 alain.thiaville 2012-03-27 07:21:25 UTC
ok for this 2 files are modified.
1) guiutil.py
[Alain@alix wicd]$ diff -u  packages/wicd-1.7.0-10/usr/share/wicd/gtk/guiutil.py patches/guiutil-740256-corrected.py 
--- packages/wicd-1.7.0-10/usr/share/wicd/gtk/guiutil.py        2010-01-15 05:49:11.000000000 +0100
+++ patches/guiutil-740256-corrected.py 2012-03-27 09:11:53.171323999 +0200
@@ -106,13 +106,11 @@
     dialog.vbox.pack_end(hbox, True, True, 0)
     dialog.show_all()
 
+    text = ''
     if dialog.run() == gtk.RESPONSE_OK:
-        text = entry.get_text()
-        dialog.destroy()
-        return text
-    else:
-        dialog.destroy()
-        return None
+        text = entry.get_text().strip()
+    dialog.destroy()
+    return text
 
 class SmallLabel(gtk.Label):
     def __init__(self, text=''):

2) netentry.py 
[Alain@alix wicd]$ diff -u packages/wicd-1.7.0-10/usr/share/wicd/gtk/netentry.py patches/netentry-740256-corrected.py
--- packages/wicd-1.7.0-10/usr/share/wicd/gtk/netentry.py       2010-01-15 05:49:11.000000000 +0100
+++ patches/netentry-740256-corrected.py        2012-03-27 09:19:13.533953730 +0200
@@ -725,7 +725,7 @@
                                   "will not be used by the computer. It " +
                                   "allows you to " + 
                                   "easily distinguish between different network " +
-                                  "profiles.", "Profile name:").strip()
+                                  "profiles.", "Profile name:")

Comment 7 David Cantrell 2012-04-25 15:38:22 UTC
I meant as actual file attachments to this bug in text/plain format, but these changes are small enough I can read it from the bugzilla comment.

Comment 8 Fedora Update System 2012-04-25 15:53:01 UTC
wicd-1.7.0-13.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/wicd-1.7.0-13.fc15

Comment 9 Fedora Update System 2012-04-27 06:06:11 UTC
Package wicd-1.7.0-13.fc15:
* should fix your issue,
* was pushed to the Fedora 15 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing wicd-1.7.0-13.fc15'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-6779/wicd-1.7.0-13.fc15
then log in and leave karma (feedback).

Comment 10 Fedora Update System 2012-05-10 14:33:03 UTC
wicd-1.7.0-13.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.