Ticket #5884 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

funky character in AP name means no X

Reported by: markvdb Owned by: marco
Priority: blocker Milestone: Update.1
Component: sugar Version: Build 650
Keywords: review? Cc: marco, tomeu
Action Needed: Verified: no
Deployments affected: Blocked By:
Blocking:

Description

problem: Trying to associate with an AP named "Gérard" does not work; the "é" confuses /usr/lib/python2.5/ConfigParser.py . It borks out at line 511 with a NoSectionError.

stopgap solution (as suggested by tomeu on #olpc): Remove /home/olpc/.sugar/default/nm/network.cfg , wait for X to respawn. X boots fine

Change History

Changed 2 years ago by tomeu

  • component changed from distro to sugar

From irc:

  /usr/lib/python2.5/ConfigParser.py, line 511, in get
 rais NoSectionError(section)
 ConfigParser:NoSectionError No section u'G\xe9rard'

Changed 2 years ago by jg

  • keywords wifi associate ap accent removed
  • verified unset
  • milestone changed from Never Assigned to Update.1

Ouch!

As I understand this bug, it causes the system to fail until manual action is taken...

Changed 2 years ago by tomeu

  • cc marco added
  • keywords review? added

The following patch fixes the encoding mismatch and also protects us from other unexpected failures in the reading of the network config file:

diff --git a/shell/hardware/nminfo.py b/shell/hardware/nminfo.py
index c1a6326..3a93120 100644
--- a/shell/hardware/nminfo.py
+++ b/shell/hardware/nminfo.py
@@ -394,15 +394,13 @@ class NMInfo(object):
         config.read(self._cfg_file)
         networks = {}
         for name in config.sections():
-            if not isinstance(name, unicode):
-                name = unicode(name)
-            net = Network(name)
             try:
+                net = Network(name)
                 net.read_from_config(config)
                 networks[name] = net
-            except NetworkInvalidError, e:
-                logging.debug("Error: invalid stored network config: %s" % e)
-                del net
+            except Exception, e:
+                logging.error("Error when processing config for the network %s: %r" % (name, e))
+
         del config
         return networks

Changed 2 years ago by dcbw

Patch looks fine as long as somebody tests it with ASCII and UTF-8/non-English characters. Note that D-Bus will require that the network name be valid UTF-8 when Sugar asks NM to activate the network. You've got to ensure that the network names returned by NetworkManager in the network list (which are going to be UTF-8) match up with the network names saved in the networks.cfg file.

Changed 2 years ago by tomeu

  • cc tomeu added
  • owner changed from tomeu to marco

Thanks Dan for the review.

At last managed to test this by creating an ad-hoc network between two xos, with an ñ in the essid.

Pushed to git. Marco, can you put this in a rpm? Thanks!

Changed 2 years ago by marco

  • status changed from new to closed
  • resolution set to fixed

Tomeu tested this one. I verified that the code is in joyride.

Note: See TracTickets for help on using tickets.