Bugfix in  PythonAsciiEncoding
@@ -194,7 +194,7 @@ namespace IronPython.Runtime {
private int _index;
public override bool Fallback(char charUnknownHigh, char charUnknownLow, int index) {
- throw PythonOps.UnicodeEncodeError("'ascii' codec can't encode character '\\u{0:X}{1:04X}' in position {1}: ordinal not in range(128)", (int)charUnknownHigh, (int)charUnknownLow, index);
+ throw PythonOps.UnicodeEncodeError("'ascii' codec can't encode character '\\u{0:X}{1:04X}' in position {2}: ordinal not in range(128)", (int)charUnknownHigh, (int)charUnknownLow, index);
}
public override bool Fallback(char charUnknown, int index) {
@@ -207,6 +207,9 @@ namespace IronPython.Runtime {
}
public override char GetNextChar() {
+ if (_index == _buffer.Count) {
+ return char.MinValue;
+ }
return _buffer[_index++];
}
