# HG changeset patch # User Julien Enselme # Date 1498591578 -7200 # Node ID 5174094159076271cc3ab1238ff89b66d2c0d215 # Parent 47444533169ef0016b20fe116535c84a94519b69 #251705: UnicodeDecodeError pop-up while entering \x code diff -r 47444533169e -r 517409415907 python.source/src/org/netbeans/modules/python/source/PythonParser.java --- a/python.source/src/org/netbeans/modules/python/source/PythonParser.java Sun Jun 25 18:25:05 2017 +0200 +++ b/python.source/src/org/netbeans/modules/python/source/PythonParser.java Tue Jun 27 21:26:18 2017 +0200 @@ -73,6 +73,7 @@ import org.python.antlr.base.stmt; import org.python.antlr.runtime.ANTLRReaderStream; import org.python.antlr.runtime.CharStream; +import org.python.core.PyException; /** * Parser for Python. Wraps Jython. @@ -374,6 +375,11 @@ } else { return sanitize(context, sanitizing); } + + } catch (PyException e) { + // This is issue 251705 + Logger.getLogger(this.getClass().getName()).log(Level.WARNING, e.getMessage()); + return new PythonParserResult(null, context.snapshot); } catch (IllegalArgumentException e) { Logger.getLogger(this.getClass().getName()).log(Level.WARNING, e.getMessage()); return new PythonParserResult(null, context.snapshot);