Skip to content

Commit

Permalink
BUG: don't use local() in read_* functions, breaks sys.settrace. close
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed Jun 29, 2012
1 parent 76ac02e commit 07cea90
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
3 changes: 2 additions & 1 deletion RELEASE.rst
Expand Up @@ -25,7 +25,7 @@ Where to get it
pandas 0.8.0
============

**Release date:** 6/26/2012
**Release date:** 6/29/2012

**New features**

Expand Down Expand Up @@ -210,6 +210,7 @@ pandas 0.8.0
- Pass keywords to pyplot.boxplot in DataFrame.boxplot (#1493)
- Bug fixes in MonthBegin (#1483)
- Preserve MultiIndex names in drop (#1513)
- Fix Panel DataFrame slice-assignment bug (#1533)

pandas 0.7.3
============
Expand Down
46 changes: 39 additions & 7 deletions pandas/io/parsers.py
Expand Up @@ -153,7 +153,6 @@ def _read(cls, filepath_or_buffer, kwds):
from urllib2 import urlopen
filepath_or_buffer = urlopen(filepath_or_buffer)
if py3compat.PY3: # pragma: no cover
from io import TextIOWrapper
if encoding:
errors = 'strict'
else:
Expand Down Expand Up @@ -215,7 +214,19 @@ def read_csv(filepath_or_buffer,
delimiter=None,
encoding=None,
squeeze=False):
kwds = locals()
kwds = dict(filepath_or_buffer=filepath_or_buffer,
sep=sep, dialect=dialect,
header=header, index_col=index_col,
names=names, skiprows=skiprows,
na_values=na_values, thousands=thousands,
comment=comment, parse_dates=parse_dates,
keep_date_col=keep_date_col,
dayfirst=dayfirst, date_parser=date_parser,
nrows=nrows, iterator=iterator,
chunksize=chunksize, skip_footer=skip_footer,
converters=converters, verbose=verbose,
delimiter=delimiter, encoding=encoding,
squeeze=squeeze)

# Alias sep -> delimiter.
sep = kwds.pop('sep')
Expand Down Expand Up @@ -248,7 +259,19 @@ def read_table(filepath_or_buffer,
delimiter=None,
encoding=None,
squeeze=False):
kwds = locals()
kwds = dict(filepath_or_buffer=filepath_or_buffer,
sep=sep, dialect=dialect,
header=header, index_col=index_col,
names=names, skiprows=skiprows,
na_values=na_values, thousands=thousands,
comment=comment, parse_dates=parse_dates,
keep_date_col=keep_date_col,
dayfirst=dayfirst, date_parser=date_parser,
nrows=nrows, iterator=iterator,
chunksize=chunksize, skip_footer=skip_footer,
converters=converters, verbose=verbose,
delimiter=delimiter, encoding=encoding,
squeeze=squeeze)

# Alias sep -> delimiter.
sep = kwds.pop('sep')
Expand Down Expand Up @@ -284,8 +307,19 @@ def read_fwf(filepath_or_buffer,
verbose=False,
encoding=None,
squeeze=False):

kwds = locals()
kwds = dict(filepath_or_buffer=filepath_or_buffer,
colspecs=colspecs, widths=widths,
header=header, index_col=index_col,
names=names, skiprows=skiprows,
na_values=na_values, thousands=thousands,
comment=comment, parse_dates=parse_dates,
keep_date_col=keep_date_col,
dayfirst=dayfirst, date_parser=date_parser,
nrows=nrows, iterator=iterator,
chunksize=chunksize, skip_footer=skip_footer,
converters=converters, verbose=verbose,
delimiter=delimiter, encoding=encoding,
squeeze=squeeze)

# Check input arguments.
colspecs = kwds.get('colspecs', None)
Expand Down Expand Up @@ -466,8 +500,6 @@ def __init__(self, f, delimiter=None, dialect=None, names=None, header=0,
self.squeeze = squeeze

def _make_reader(self, f):
import csv

sep = self.delimiter

if sep is None or len(sep) == 1:
Expand Down

0 comments on commit 07cea90

Please sign in to comment.