# Buggy code
def _next_line(self):
    if isinstance(self.data, list):
        while self.skipfunc(self.pos):
            self.pos += 1

        while True:
            try:
                line = self._check_comments([self.data[self.pos]])[0]
                self.pos += 1
                # either uncommented or blank to begin with
                if not self.skip_blank_lines and (
                    self._empty(self.data[self.pos - 1]) or line
                ):
                    break
                elif self.skip_blank_lines:
                    ret = self._check_empty([line])
                    if ret:
                        line = ret[0]
                        break
            except IndexError:
                raise StopIteration
    else:
        while self.skipfunc(self.pos):
            self.pos += 1
            next(self.data)

        while True:
            try:
                orig_line = next(self.data)
            except csv.Error as e:
                msg = str(e)

                if "NULL byte" in str(e):
                    msg = (
                        "NULL byte detected. This byte "
                        "cannot be processed in Python's "
                        "native csv library at the moment, "
                        "so please pass in engine='c' instead"
                    )

                if self.skipfooter > 0:
                    reason = (
                        "Error could possibly be due to "
                        "parsing errors in the skipped footer rows "
                        "(the skipfooter keyword is only applied "
                        "after Python's csv library has parsed "
                        "all rows)."
                    )
                    msg += ". " + reason

                raise csv.Error(msg)
            line = self._check_comments([orig_line])[0]
            self.pos += 1
            if not self.skip_blank_lines and (self._empty(orig_line) or line):
                break
            elif self.skip_blank_lines:
                ret = self._check_empty([line])
                if ret:
                    line = ret[0]
                    break

    # This was the first line of the file,
    # which could contain the BOM at the
    # beginning of it.
    if self.pos == 1:
        line = self._check_for_bom(line)

    self.line_pos += 1
    self.buf.append(line)
    return line


# Traceback (ValueError)
from pandas.compat import StringIO

pd.read_csv(StringIO('''Date,Value
1/1/2012,100.00
1/2/2012,102.00
"a quoted junk row"morejunk'''),  skipfooter=1)

Out[21]
ERROR:root:An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (1, 20))

---------------------------------------------------------------------------
Error                                     Traceback (most recent call last)
<ipython-input-34-d8dff6b9f4a7> in <module>()
2 1/1/2012,100.00
3 1/2/2012,102.00
----> 4 "a quoted junk row" '''),  skipfooter=1)

C:\Users\chris.bartak\Documents\python-dev\pandas\pandas\io\parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, escapechar, comment, encoding, dialect, tupleize_cols, error_bad_lines, warn_bad_lines, skipfooter, skip_footer, doublequote, delim_whitespace, as_recarray, compact_ints, use_unsigned, low_memory, buffer_lines, memory_map, float_precision)
651                     skip_blank_lines=skip_blank_lines)
652
--> 653         return _read(filepath_or_buffer, kwds)
654
655     parser_f.__name__ = name

C:\Users\chris.bartak\Documents\python-dev\pandas\pandas\io\parsers.py in _read(filepath_or_buffer, kwds)
404
405     try:
--> 406         data = parser.read()
407     finally:
408         parser.close()

C:\Users\chris.bartak\Documents\python-dev\pandas\pandas\io\parsers.py in read(self, nrows)
977                 raise ValueError('skipfooter not supported for iteration')
978
--> 979         ret = self._engine.read(nrows)
980
981         if self.options.get('as_recarray'):

C:\Users\chris.bartak\Documents\python-dev\pandas\pandas\io\parsers.py in read(self, rows)
2066     def read(self, rows=None):
2067         try:
-> 2068             content = self._get_lines(rows)
2069         except StopIteration:
2070             if self._first_chunk:

C:\Users\chris.bartak\Documents\python-dev\pandas\pandas\io\parsers.py in _get_lines(self, rows)
2717                         while True:
2718                             try:
-> 2719                                 new_rows.append(next(source))
2720                                 rows += 1
2721                             except csv.Error as inst:

Error: ',' expected after '"'

# Fixed code
def _next_line(self):
    if isinstance(self.data, list):
        while self.skipfunc(self.pos):
            self.pos += 1

        while True:
            try:
                line = self._check_comments([self.data[self.pos]])[0]
                self.pos += 1
                # either uncommented or blank to begin with
                if not self.skip_blank_lines and (
                    self._empty(self.data[self.pos - 1]) or line
                ):
                    break
                elif self.skip_blank_lines:
                    ret = self._check_empty([line])
                    if ret:
                        line = ret[0]
                        break
            except IndexError:
                raise StopIteration
    else:
        while self.skipfunc(self.pos):
            self.pos += 1
            next(self.data)

        while True:
            orig_line = self._next_iter_line()
            line = self._check_comments([orig_line])[0]
            self.pos += 1
            if not self.skip_blank_lines and (self._empty(orig_line) or line):
                break
            elif self.skip_blank_lines:
                ret = self._check_empty([line])
                if ret:
                    line = ret[0]
                    break

    # This was the first line of the file,
    # which could contain the BOM at the
    # beginning of it.
    if self.pos == 1:
        line = self._check_for_bom(line)

    self.line_pos += 1
    self.buf.append(line)
    return line