#257531: Prevent errors on files containing non ascii characters without the encoding header
authorJulien Enselme <jenselme@netbeans.org>
Sun, 04 Dec 2016 13:37:51 +0100
changeset 183926ccd27d3f884
parent 18391 044f0cf6fb6b
child 18397 0f6ff4e8e09f
#257531: Prevent errors on files containing non ascii characters without the encoding header
python.source/src/org/netbeans/modules/python/source/PythonParser.java
     1.1 --- a/python.source/src/org/netbeans/modules/python/source/PythonParser.java	Tue Nov 22 10:31:36 2016 +0100
     1.2 +++ b/python.source/src/org/netbeans/modules/python/source/PythonParser.java	Sun Dec 04 13:37:51 2016 +0100
     1.3 @@ -374,6 +374,9 @@
     1.4              } else {
     1.5                  return sanitize(context, sanitizing);
     1.6              }
     1.7 +        } catch (IllegalArgumentException e) {
     1.8 +            Logger.getLogger(this.getClass().getName()).log(Level.WARNING, e.getMessage());
     1.9 +            return new PythonParserResult(null, context.snapshot);
    1.10          } catch (NullPointerException e) {
    1.11              String fileName = "";
    1.12              if (file != null) {