Revision: 8c3c2388f6d8
Branch:   default
Author:   Pekka Klärck
Date:     Wed Sep 18 07:58:48 2013 UTC
Log:      Fixed handling too big values with \U on Jython.

Update issue 1524
Interestingly unichr raised TypeError with very large values on Jython when it raises OverflowError on Python. Changed the code to handle both.
http://code.google.com/p/robotframework/source/detail?r=8c3c2388f6d8

Modified:
 /src/robot/utils/escaping.py

=======================================
--- /src/robot/utils/escaping.py        Wed Sep 18 07:45:56 2013 UTC
+++ /src/robot/utils/escaping.py        Wed Sep 18 07:58:48 2013 UTC
@@ -80,10 +80,18 @@

     def _unescape_character(self, text, length, escape):
         try:
-            ordinal = self._get_ordinal(text, length)
-            return unichr(ordinal) + text[length:]
-        except (ValueError, OverflowError):
+            char = self._get_character(text, length)
+        except ValueError:
             return escape + text
+        else:
+            return char + text[length:]
+
+    def _get_character(self, text, length):
+        ordinal = self._get_ordinal(text, length)
+        try:
+            return unichr(ordinal)
+        except (OverflowError, TypeError):
+            raise ValueError

     def _get_ordinal(self, text, length):
         if len(text) < length:

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to robotframework-commit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to