main icon indicating copy to clipboard operation
main copied to clipboard

Encoding parsing doesn't give good error message for invalid encoding

Open ironpythonbot opened this issue 10 years ago • 7 comments

#  -*- coding: nonsense -*-

print "Testing..."  

Traceback (most recent call last):  
File mscorlib, line unknown, in .ctor  
File mscorlib, line unknown, in .ctor  
TypeError: Value cannot be null.  
Parameter name: encoding  

Work Item Details

Original CodePlex Issue: Issue 1019 Status: Active Reason Closed: Unassigned Assigned to: Unassigned Reported on: Jul 17, 2006 at 5:38 PM Updated on: Feb 22, 2013 at 2:17 AM Updated by: jdhardy Test: test_codecs.py (test_cp1019) Thanks: Snaury

ironpythonbot avatar Dec 09 '14 16:12 ironpythonbot

On 2007-11-01 04:48:22 UTC, sborde commented:

Its a negative scenario

ironpythonbot avatar Dec 09 '14 16:12 ironpythonbot

On 2009-05-22 10:29:03 UTC, unknown user commented:

We now report "unknown encoding type"

ironpythonbot avatar Dec 09 '14 16:12 ironpythonbot

On 2009-10-30 04:02:21 UTC, dfugate commented:

Not fixed. The correct error message is "SyntaxError: encoding problem: with BOM".

ironpythonbot avatar Dec 09 '14 16:12 ironpythonbot

On 2009-10-30 04:05:28 UTC, dfugate commented:

No dev added test and not fixed.

ironpythonbot avatar Dec 09 '14 16:12 ironpythonbot

Current output is this:

SyntaxError: encoding problem: nonsense

slide avatar Oct 25 '16 16:10 slide

There is a different error message printed out on CPy 2.7

SyntaxError: encoding problem: nonsense

slide avatar Oct 25 '16 20:10 slide

This issue was moved to IronLanguages/ironpython2#183

slide avatar Jun 23 '17 03:06 slide