[Jython-checkins] jython: Update our _csv. See http://bugs.python.org/issue16013

frank.wierzbicki jython-checkins at python.org
Mon Mar 11 18:23:44 CET 2013


http://hg.python.org/jython/rev/019685a1fde6
changeset:   7076:019685a1fde6
user:        Frank Wierzbicki <fwierzbicki at gmail.com>
date:        Sat Mar 09 13:01:55 2013 -0800
summary:
  Update our _csv. See http://bugs.python.org/issue16013

files:
  src/org/python/modules/_csv/PyReader.java |  12 +++++++---
  1 files changed, 8 insertions(+), 4 deletions(-)


diff --git a/src/org/python/modules/_csv/PyReader.java b/src/org/python/modules/_csv/PyReader.java
--- a/src/org/python/modules/_csv/PyReader.java
+++ b/src/org/python/modules/_csv/PyReader.java
@@ -69,11 +69,15 @@
             lineobj = input_iter.__iternext__();
             if (lineobj == null) {
                 // End of input OR exception
-                if (field.length() != 0) {
-                    throw _csv.Error("newline inside string");
-                } else {
-                    return null;
+                if (field.length() != 0 || state == ParserState.IN_QUOTED_FIELD) {
+                    if (dialect.strict) {
+                        throw _csv.Error("unexpected end of data");
+                    } else {
+                        parse_save_field();
+                        break;
+                    }
                 }
+                return null;
             }
 
             line_num++;

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list