Skip to content

Commit 41e6083

Browse files
committed
BUG: #680 incorporate @takluyver comments
1 parent b4ca18b commit 41e6083

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: pandas/core/common.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -818,8 +818,8 @@ def console_encode(value):
818818
if not isinstance(value, unicode):
819819
return value
820820

821-
import sys
822-
if sys.stdin is not None and sys.stdin.encoding is not None:
823-
return value.encode(sys.stdin.encoding)
824-
else:
821+
try:
822+
import sys
823+
return value.encode(sys.stdin.encoding, 'replace')
824+
except AttributeError:
825825
return value.encode('ascii', 'replace')

0 commit comments

Comments
 (0)