Skip to content

BUG: Fix read_csv on S3 files for python 3 #9561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ci/requirements-2.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ lxml=3.2.1
scipy
xlsxwriter=0.4.6
statsmodels
boto=2.26.1
boto=2.36.0
bottleneck=0.8.0
psycopg2=2.5.2
patsy
Expand Down
4 changes: 4 additions & 0 deletions doc/source/whatsnew/v0.16.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -344,3 +344,7 @@ Bug Fixes
- Bug in groupby MultiIndex with missing pair (:issue:`9049`, :issue:`9344`)
- Fixed bug in ``Series.groupby`` where grouping on ``MultiIndex`` levels would ignore the sort argument (:issue:`9444`)
- Fix bug in ``DataFrame.Groupby`` where sort=False is ignored in case of Categorical columns. (:issue:`8868`)



- Fixed bug with reading CSV files from Amazon S3 on python 3 raising a TypeError (:issue:`9452`)
3 changes: 2 additions & 1 deletion pandas/io/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ def get_filepath_or_buffer(filepath_or_buffer, encoding=None):
b = conn.get_bucket(parsed_url.netloc)
k = boto.s3.key.Key(b)
k.key = parsed_url.path
filepath_or_buffer = BytesIO(k.get_contents_as_string())
filepath_or_buffer = BytesIO(k.get_contents_as_string(
encoding=encoding))
return filepath_or_buffer, None


Expand Down
3 changes: 0 additions & 3 deletions pandas/io/tests/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3802,9 +3802,6 @@ def setUp(self):
except ImportError:
raise nose.SkipTest("boto not installed")

if compat.PY3:
raise nose.SkipTest("boto incompatible with Python 3")

@tm.network
def test_parse_public_s3_bucket(self):
import nose.tools as nt
Expand Down