In system-config-network, when i check "Set MTU to 1500" for eth0 and I save it crashes and it says to file a bug report. Component: system-config-network Version: 1.5.93 Summary: TB334155f4 ConfShellVar.py:66:__setitem__:TypeError: expected string or buffer Traceback (most recent call last): File "/usr/share/system-config-network/netconfpkg/gui/maindialog.py", line 805, in on_activateButton_clicked self.activateButtonFunc[self.active_page](button) File "/usr/share/system-config-network/netconfpkg/gui/maindialog.py", line 1021, in on_deviceActivateButton_clicked if self.save() != 0: File "/usr/share/system-config-network/netconfpkg/gui/maindialog.py", line 411, in save self.saveDevices() File "/usr/share/system-config-network/netconfpkg/gui/maindialog.py", line 431, in saveDevices devicelist.save() File "/usr/share/system-config-network/netconfpkg/NCDeviceList.py", line 238, in save dev.save() File "/usr/share/system-config-network/netconfpkg/NCDevice.py", line 413, in save conf[confkey] = getattr(self, selfkey) File "/usr/share/system-config-network/netconfpkg/conf/ConfShellVar.py", line 66, in __setitem__ if self.quotereg.search(value): TypeError: expected string or buffer Local variables in innermost frame: varname: MTU self: <netconfpkg.NCDevice.ConfDevice instance at 0xa75e20c> place: 2 value: 1500 missing: 1
Same problem here.
Problem here is that ConfShellVar __setitem__ it not able to cope with variables that have a numeric value. /usr/share/system-config-network/netconfpkg/conf/ConfShellVar.py Adding the following as line 53 fixes the problem by forcing value to be a string value='%s'%(value) #ensure value is a string output from diff -c *** orig 2008-11-28 10:57:59.000000000 +0000 --- ConfShellVar.py 2008-11-28 11:01:32.000000000 +0000 *************** *** 50,55 **** --- 50,56 ---- # prevent tracebacks if not value: value = "" + value='%s'%(value) #ensure value is a string # set *every* instance of varname to value to avoid surprises place = self.tell() self.rewind()
Hi, I just checked to see if this issue has been fixed. In updates for Fedora 10 there is system-config-network-tui-1.5.95-1.fc10.noarch.rpm which seems to work fine. The fix seems to be to be in system-config-network/netconfpkg/NCDevice.py @@ -409,8 +411,8 @@ for selfkey in self.__intkeydict.keys(): confkey = self.__intkeydict[selfkey] - if hasattr(self, selfkey): - conf[confkey] = getattr(self, selfkey) + if hasattr(self, selfkey) and getattr(self, selfkey) != None: + conf[confkey] = str(getattr(self, selfkey)) else: del conf[confkey] It is the str() function call that fixes the problem by ensuring the value is a string, in a similar way to my '%s'%(value) patch. So I think this issue can be closed as it has already been fixed by someone.
Thank you for the bug report. This particular bug was fixed and an updated package was published for download. If you find that the bug still persists feel free to reopen this bug. You can obtain the updated package by typing 'yum update <package>' or using the graphical updater, Software Update.