diff options
| author | Kenneth Reitz <me@kennethreitz.org> | 2014-01-08 11:44:20 -0800 |
|---|---|---|
| committer | Kenneth Reitz <me@kennethreitz.org> | 2014-01-08 11:44:20 -0800 |
| commit | 9c2018653fc8d02f1db727dd73cfc61b3fcfa81d (patch) | |
| tree | 857673f6e9ae71a934e4b43f62da83e12d8027a3 | |
| parent | 7f0748aac9d561672ecf41684c28d97e4e186229 (diff) | |
| parent | 9e45b95d1238fa530ee7b26a7f0acb6443c10907 (diff) | |
| download | tablib-9c2018653fc8d02f1db727dd73cfc61b3fcfa81d.tar.gz | |
Merge pull request #111 from dec0dedab0de/develop
using readlines() in _tsv.py fixes a small bug.
| -rw-r--r-- | .travis.yml | 3 | ||||
| -rw-r--r-- | tablib/formats/_tsv.py | 4 | ||||
| -rw-r--r-- | tablib/formats/_yaml.py | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml index 82a9a9f..b45810f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,5 +3,6 @@ python: - 2.6 - 2.7 - 3.2 -install: python setup.py install +install: + - python setup.py install script: python test_tablib.py diff --git a/tablib/formats/_tsv.py b/tablib/formats/_tsv.py index 816b6e3..8ef2b67 100644 --- a/tablib/formats/_tsv.py +++ b/tablib/formats/_tsv.py @@ -34,9 +34,9 @@ def import_set(dset, in_stream, headers=True): dset.wipe() if is_py3: - rows = csv.reader(in_stream.split('\r\n'), delimiter='\t') + rows = csv.reader(in_stream.splitlines(), delimiter='\t') else: - rows = csv.reader(in_stream.split('\r\n'), delimiter='\t', + rows = csv.reader(in_stream.splitlines(), delimiter='\t', encoding=DEFAULT_ENCODING) for i, row in enumerate(rows): diff --git a/tablib/formats/_yaml.py b/tablib/formats/_yaml.py index 91a3baa..e2ccf46 100644 --- a/tablib/formats/_yaml.py +++ b/tablib/formats/_yaml.py @@ -46,7 +46,7 @@ def import_book(dbook, in_stream): dbook.wipe() - for sheet in yaml.safe_load(in_stream): + for sheet in yaml.load(in_stream): data = tablib.Dataset() data.title = sheet['title'] data.dict = sheet['data'] |
