[csw-devel] SF.net SVN: gar:[16908] csw/mgar/gar/v2/lib/web/pkgdb_web.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Thu Jan 26 10:00:14 CET 2012


Revision: 16908
          http://gar.svn.sourceforge.net/gar/?rev=16908&view=rev
Author:   wahwah
Date:     2012-01-26 09:00:14 +0000 (Thu, 26 Jan 2012)
Log Message:
-----------
pkgdb-web: Rescue bad unicode in pkgmap

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/web/pkgdb_web.py

Modified: csw/mgar/gar/v2/lib/web/pkgdb_web.py
===================================================================
--- csw/mgar/gar/v2/lib/web/pkgdb_web.py	2012-01-26 08:56:08 UTC (rev 16907)
+++ csw/mgar/gar/v2/lib/web/pkgdb_web.py	2012-01-26 09:00:14 UTC (rev 16908)
@@ -351,6 +351,13 @@
         data_structure["pkginfo"]["VENDOR"] = self.GetUnicodeOrNone(
             data_structure["pkginfo"]["VENDOR"])
       # The end of the hack.
+      #
+      # One more workaround
+      for d in data_structure["pkgmap"]:
+        if "path" in d:
+          d["path"] = self.GetUnicodeOrNone(d["path"])
+          d["line"] = self.GetUnicodeOrNone(d["line"])
+      # End of the workaround
       return json.dumps(data_structure, cls=PkgStatsEncoder)
     except sqlobject.main.SQLObjectNotFound, e:
       raise web.notfound()

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list