Skip to content

Commit 79df67a

Browse files
hshimizu77jreback
authored andcommitted
BUG: parser_source as a filename with non utf-8 encoding in Windows filesystem (GH6807)
1 parent ac189a2 commit 79df67a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/source/release.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ Bug Fixes
449449
- Moved ``Panel.shift`` to ``NDFrame.slice_shift`` and fixed to respect multiple dtypes. (:issue:`6959`)
450450
- Bug in enabling ``subplots=True`` in ``DataFrame.plot`` only has single column raises ``TypeError``, and ``Series.plot`` raises ``AttributeError`` (:issue:`6951`)
451451
- Bug in ``DataFrame.plot`` draws unnecessary axes when enabling ``subplots`` and ``kind=scatter`` (:issue:`6951`)
452+
- Bug in ``read_csv`` from a filesystem with non-utf-8 encoding (:issue:`6807`)
452453

453454
pandas 0.13.1
454455
-------------

pandas/parser.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ cdef class TextReader:
535535

536536
if isinstance(source, basestring):
537537
if not isinstance(source, bytes):
538-
source = source.encode('utf-8')
538+
source = source.encode(sys.getfilesystemencoding() or 'utf-8')
539539

540540
if self.memory_map:
541541
ptr = new_mmap(source)

0 commit comments

Comments
 (0)