Hi ironpython,
Here's your Daily Digest of new issues for project "IronPython".
In today's digest:ISSUES
1. [New comment] json.dump fails to dump Unicode strings
2. [New comment] unicode.encode() returns wrong type
3. [New comment] unicode.encode() returns wrong type
4. [New comment] unicode.encode() returns wrong type
----------------------------------------------
ISSUES
1. [New comment] json.dump fails to dump Unicode strings
http://ironpython.codeplex.com/workitem/32331
User paweljasinski has commented on the issue:
"<p>workaround:
https://github.com/paweljasinski/IronLanguages/commit/365933a00d1a1b65e7bc06ee6dec660f07d9923d</p>"-----------------
2. [New comment] unicode.encode() returns wrong type
http://ironpython.codeplex.com/workitem/34842
User paweljasinski has commented on the issue:
"<p>Can you give me exact problem with tornado (preferred on the mailing list).
I have been tinkering with it recently
(https://github.com/paweljasinski/tornado/compare/facebook:branch3.1...iron-wip)
and got reasonable results with ipython notebook.</p><p>From what I can see
there are the following instances of the pattern (tornado uses unicode_type,
not unicode directly):<br>```<br>auth.py:1008: if
isinstance(extended_permissions, (unicode_type, bytes_type)):<br>auth.py:1145:
if isinstance(body, unicode_type):<br>auth.py:1362: if isinstance(val,
unicode_type):<br>escape.py:191: assert isinstance(value, unicode_type),
\<br>test/locale_test.py:49: self.assertTrue(isinstance(name,
unicode_type))<br>util.py:211: if isinstance(impl, (unicode_type,
bytes_type)):<br>web.py:322: elif isinstance(value,
unicode_type):<br>web.py:370: if isinstance(v,
unicode_type):<br>web.py:554: if isinstance(file_part,
(unicode_type, bytes_type)):<br>web.py:563: if
isinstance(file_part, (unicode_type, bytes_type)):<br>web.py:2401:
if isinstance(f, (unicode_type, bytes_type)):<br>web.py:2413: if
isinstance(f, (unicode_type, bytes_type)):<br>web.py:2512: if not
isinstance(a, (unicode_type, bytes_type)):<br>websocket.py:464: if
isinstance(message, unicode_type):<br>```<br>After we take out all of
unicode_type or bytes_type, which are not what you are talking about, there
are:<br>```<br>auth.py:1145: if isinstance(body,
unicode_type):<br>auth.py:1362: if isinstance(val,
unicode_type):<br>escape.py:191: assert isinstance(value, unicode_type),
\<br>test/locale_test.py:49: self.assertTrue(isinstance(name,
unicode_type))<br>web.py:322: elif isinstance(value,
unicode_type):<br>web.py:370: if isinstance(v,
unicode_type):<br>websocket.py:464: if isinstance(message,
unicode_type):<br>```<br>we have 7 hits.<br>I looked at first 2 and from what I
can tell, pattern is not to avoid double encoding of strings, but to make sure
nothing bigger than 255 is passed down. In case of misdiagnosed ascii strings
it makes no harm.</p><p>From my experience the real show stopper is here:
https://ironpython.codeplex.com/workitem/32331</p><p> <br></p>"-----------------
3. [New comment] unicode.encode() returns wrong type
http://ironpython.codeplex.com/workitem/34842
User bdarnell has commented on the issue:
"<p>The main issue is tornado.escape.utf8, which calls .encode('utf8') on
unicode strings and does nothing for byte strings. This is used often in
tornado code and is expected to be idempotent, but on IronPython it is
not.</p>"-----------------
4. [New comment] unicode.encode() returns wrong type
http://ironpython.codeplex.com/workitem/34842
User paweljasinski has commented on the issue:
"<p>after applying the following to json/encode.py I can even round trip
umlauts in notebook.<br>```<br>+++
b/External.LCA_RESTRICTED/Languages/IronPython/27/Lib/json/encoder.py<br>@@
-45,7 +45,11 @@ def py_encode_basestring_ascii(s):</p><p>
"""<br> if isinstance(s, str) and HAS_UTF8.search(s) is not
None:<br>- s = s.decode('utf-8')<br>+ try:<br>+ s =
s.decode('utf-8')<br>+ except UnicodeDecodeError as ex:<br>+
print "ignoring %s" % ex<br>+ pass<br> def
replace(match):<br> s = match.group(0)<br> try:<br>```<br></p>"
----------------------------------------------
----------------------------------------------
You are receiving this email because you subscribed to notifications on
CodePlex.
To report a bug, request a feature, or add a comment, visit IronPython Issue
Tracker. You can unsubscribe or change your issue notification settings on
CodePlex.com.
_______________________________________________
Ironpython-users mailing list
Ironpython-users@python.org
https://mail.python.org/mailman/listinfo/ironpython-users