<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 issue] bytes.decode() encoding should default to sys.getdefaultencoding(), not None</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 issue] bytes.decode() encoding should default to sys.getdefaultencoding(), not None</span> <a href="http://ironpython.codeplex.com/workitem/34532">view online</a></div><p>User marcel_r has proposed the issue:</p><p>"<h1>----------------------------------------------------------------------------------------------------</h1>
IP VERSION AFFECTED: 2.7.4<br />
BUILD TYPE: Release<br />
FLAGS PASSED TO IPY.EXE: None<br />
OPERATING SYSTEM: 32-bit WinXP<br />
CLR VERSION: .NET 4.0<br />
<h1>----------------------------------------------------------------------------------------------------</h1>
BRIEF DESCRIPTION:<br />
The method bytes.decode([encoding[,errors]]) can be called without arguments. In this case, according to Python documentation, "encoding will be the default encoding," which I believe is the value returned from sys.getdefaultencoding(). This works on CPython 2.7. On IronPython 2.7.4, however, encoding apparently defaults to None, causing a TypeError whenever you call bytes.encoding() without arguments.<br />
Note that str.decode() doesn't have this problem.<br />
<h1>----------------------------------------------------------------------------------------------------</h1>
REPRODUCTION SNIPPET:<br />
<blockquote>
<blockquote>
<blockquote>
"foo".decode()<br />
'foo'<br />
b"foo".decode()<br />
Traceback (most recent call last):<br />
File "<stdin>", line 1, in <module><br />
TypeError: decode() expected string, got 'NoneType'<br />
import sys<br />
b"foo".decode(sys.getdefaultencoding())<br />
'foo'<br />
</blockquote>
</blockquote>
</blockquote>
"</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>