Revision: 2478
Author: janne.t.harkonen
Date: Thu Feb 18 07:44:45 2010
Log: Jython 2.2 does not have sys.getfilesystemencoding()

Luckily, the unicode paths work with Jython 2.2 without the decoding.


http://code.google.com/p/robotframework/source/detail?r=2478

Modified:
 /trunk/src/robot/parsing/model.py
 /trunk/src/robot/parsing/rawdata.py

=======================================
--- /trunk/src/robot/parsing/model.py   Wed Feb 17 23:46:06 2010
+++ /trunk/src/robot/parsing/model.py   Thu Feb 18 07:44:45 2010
@@ -59,8 +59,9 @@
         self.user_keywords = UserHandlerList(rawdata.keywords)

     def _get_name_and_source(self, path):
-        source = self._get_source(path).decode(sys.getfilesystemencoding(),
-                                               'ignore')
+        source = self._get_source(path)
+        if not utils.is_jython:
+            source = source.decode(sys.getfilesystemencoding(), 'ignore')
         return self._get_name(source), source

     def _get_name(self, source):
=======================================
--- /trunk/src/robot/parsing/rawdata.py Wed Feb 17 23:46:06 2010
+++ /trunk/src/robot/parsing/rawdata.py Thu Feb 18 07:44:45 2010
@@ -128,7 +128,9 @@

     def _get_curdir(self, path):
         curdir = utils.get_directory(path).replace('\\','\\\\')
-        return curdir.decode(sys.getfilesystemencoding(), 'ignore')
+        if not utils.is_jython:
+            curdir = curdir.decode(sys.getfilesystemencoding(), 'ignore')
+        return curdir

     def start_table(self, name):
         """Makes rawdata instance ready to receive new data

Reply via email to