From: <pj...@us...> - 2009-10-20 04:25:23
|
Revision: 6886 http://jython.svn.sourceforge.net/jython/?rev=6886&view=rev Author: pjenvey Date: 2009-10-20 04:25:15 +0000 (Tue, 20 Oct 2009) Log Message: ----------- don't decode bytes when searching for an encoding defined in an InputStream thanks artichoke fixes #1487 Modified Paths: -------------- trunk/jython/NEWS trunk/jython/src/org/python/core/ParserFacade.java Modified: trunk/jython/NEWS =================================================================== --- trunk/jython/NEWS 2009-10-20 04:24:54 UTC (rev 6885) +++ trunk/jython/NEWS 2009-10-20 04:25:15 UTC (rev 6886) @@ -3,6 +3,7 @@ Jython 2.5.2a1 Bugs Fixed - [ 1478 ] defaultdict & weakref.WeakKeyDictionary [TypeError: first argument must be callable] + - [ 1487 ] Import of module with latin-1 chars fails on utf-8 file encoding - Fix runtime issues during exitfuncs triggered via SystemRestart (such as during Django or Pylons development mode reloading) Modified: trunk/jython/src/org/python/core/ParserFacade.java =================================================================== --- trunk/jython/src/org/python/core/ParserFacade.java 2009-10-20 04:24:54 UTC (rev 6885) +++ trunk/jython/src/org/python/core/ParserFacade.java 2009-10-20 04:25:15 UTC (rev 6886) @@ -4,14 +4,11 @@ import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.io.OutputStreamWriter; import java.io.Reader; import java.io.StringReader; -import java.io.Writer; import java.nio.charset.CharacterCodingException; import java.nio.charset.Charset; import java.nio.charset.CharsetDecoder; @@ -25,7 +22,6 @@ import org.python.antlr.BaseParser; import org.python.antlr.NoCloseReaderStream; import org.python.antlr.ParseException; -import org.python.antlr.PythonLexer; import org.python.antlr.PythonPartialLexer; import org.python.antlr.PythonPartialParser; import org.python.antlr.PythonTokenSource; @@ -387,7 +383,7 @@ private static String readEncoding(InputStream stream) throws IOException { stream.mark(MARK_LIMIT); String encoding = null; - BufferedReader br = new BufferedReader(new InputStreamReader(stream), 512); + BufferedReader br = new BufferedReader(new InputStreamReader(stream, "ISO-8859-1"), 512); encoding = findEncoding(br); // XXX: reset() can still raise an IOException if a line exceeds our large mark // limit This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |