Revision: 2467
Author: janne.t.harkonen
Date: Wed Feb 17 23:46:06 2010
Log: Fixed problems with unicode characters in path
http://code.google.com/p/robotframework/source/detail?r=2467

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

=======================================
--- /trunk/src/robot/parsing/model.py   Wed Jul 29 02:29:22 2009
+++ /trunk/src/robot/parsing/model.py   Wed Feb 17 23:46:06 2010
@@ -14,6 +14,7 @@


 import os
+import sys

 from robot import utils
 from robot.errors import DataError
@@ -58,9 +59,10 @@
         self.user_keywords = UserHandlerList(rawdata.keywords)

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

=======================================
--- /trunk/src/robot/parsing/rawdata.py Mon Aug 24 12:58:26 2009
+++ /trunk/src/robot/parsing/rawdata.py Wed Feb 17 23:46:06 2010
@@ -15,6 +15,7 @@

 import re
 import os
+import sys

 from robot import utils
 from robot.errors import DataError
@@ -123,8 +124,12 @@
         self._table = None
         self._strip_comments = strip_comments
         # ${CURDIR} is replaced the data and thus must be escaped
-        self._curdir = utils.get_directory(path).replace('\\','\\\\')
-
+        self._curdir = self._get_curdir(path)
+
+    def _get_curdir(self, path):
+        curdir = utils.get_directory(path).replace('\\','\\\\')
+        return curdir.decode(sys.getfilesystemencoding(), 'ignore')
+
     def start_table(self, name):
         """Makes rawdata instance ready to receive new data

Reply via email to