Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [New issue] bytes.decode() encoding should default to 
sys.getdefaultencoding(), not None

----------------------------------------------

ISSUES

1. [New issue] bytes.decode() encoding should default to 
sys.getdefaultencoding(), not None
http://ironpython.codeplex.com/workitem/34532
User marcel_r has proposed the issue:

"----------------------------------------------------------------------------------------------------
IP VERSION AFFECTED: 2.7.4
BUILD TYPE: Release
FLAGS PASSED TO IPY.EXE: None
OPERATING SYSTEM: 32-bit WinXP
CLR VERSION: .NET 4.0
----------------------------------------------------------------------------------------------------
BRIEF DESCRIPTION:
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.
Note that str.decode() doesn't have this problem.
----------------------------------------------------------------------------------------------------
REPRODUCTION SNIPPET:



"foo".decode()
'foo'
b"foo".decode()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: decode() expected string, got 'NoneType'
import sys
b"foo".decode(sys.getdefaultencoding())
'foo'


"
----------------------------------------------



----------------------------------------------
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

Reply via email to