<html><head><style type="text/css" media="screen">Body{font-family: Verdana;font-size:.75em;}h4{font-size:.9em;}a{color: #3a62a6;}.digest .toc {margin-bottom: 15px; padding-bottom:8px; border-bottom: 1px solid #ccc;}.digest .tocItem {margin-bottom: 15px;}.tocItem a{color:#000;text-decoration: none;}.tocItem a:hover{color: #3a62a6;text-decoration: underline;}.topic{padding-bottom: 8px;margin-bottom: 20px; border-bottom: 1px solid #ccc;}.topicHeader{margin-bottom:10px;}.topicTitle{font-weight: bold;}.replies p{margin:0;padding:0;}.replies hr{width: 15%;text-align: left;margin: 0 auto 5px 0;border: none 0;border-top: 1px solid #ccc;height: 1px;}.reply{margin-bottom: 6px;padding-bottom: 4px;}.anchorMarker{color: #3a62a6;}.footer{color: gray;}</style></head><body><div class="digest"><p>Hi ironpython,</p><p>Here's your Daily Digest of new issues for project "<a href="http://ironpython.codeplex.com/">IronPython</a>".</p><p>In today's digest:</p><h4>ISSUES</h4><div class="toc"><div class="tocItem"><a href="#toc_issue_1">1. <span class="tocTitle">[New comment] json.dump fails to dump Unicode strings</span> <span class="anchorMarker">↓</span></a></div><div class="tocItem"><a href="#toc_issue_2">2. <span class="tocTitle">[New comment] unicode.encode() returns wrong type</span> <span class="anchorMarker">↓</span></a></div><div class="tocItem"><a href="#toc_issue_3">3. <span class="tocTitle">[New comment] unicode.encode() returns wrong type</span> <span class="anchorMarker">↓</span></a></div><div class="tocItem"><a href="#toc_issue_4">4. <span class="tocTitle">[New comment] unicode.encode() returns wrong type</span> <span class="anchorMarker">↓</span></a></div></div><h4>ISSUES</h4><div class="topic"><a name="toc_issue_1"></a><div class="topicHeader"><span class="topicTitle">1. [New comment] json.dump fails to dump Unicode strings</span> <a href="http://ironpython.codeplex.com/workitem/32331">view online</a></div><p>User paweljasinski has commented on the issue:</p><p>"<p>workaround: https://github.com/paweljasinski/IronLanguages/commit/365933a00d1a1b65e7bc06ee6dec660f07d9923d</p>"</p></div><div class="topic"><a name="toc_issue_2"></a><div class="topicHeader"><span class="topicTitle">2. [New comment] unicode.encode() returns wrong type</span> <a href="http://ironpython.codeplex.com/workitem/34842">view online</a></div><p>User paweljasinski has commented on the issue:</p><p>"<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>"</p></div><div class="topic"><a name="toc_issue_3"></a><div class="topicHeader"><span class="topicTitle">3. [New comment] unicode.encode() returns wrong type</span> <a href="http://ironpython.codeplex.com/workitem/34842">view online</a></div><p>User bdarnell has commented on the issue:</p><p>"<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>"</p></div><div class="topic"><a name="toc_issue_4"></a><div class="topicHeader"><span class="topicTitle">4. [New comment] unicode.encode() returns wrong type</span> <a href="http://ironpython.codeplex.com/workitem/34842">view online</a></div><p>User paweljasinski has commented on the issue:</p><p>"<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>"</p></div><div class="footer"><p>You are receiving this email because you subscribed to notifications on CodePlex.</p><p>To report a bug, request a feature, or add a comment, visit <a href="http://ironpython.codeplex.com/workitem/list/basic">IronPython Issue Tracker</a>. You can <a href="http://ironpython.codeplex.com/subscriptions/workitem/project/edit">unsubscribe or change your issue notification settings</a> on CodePlex.com.</p></div></div></body></html>