File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -1641,13 +1641,14 @@ def reset_printoptions():
1641
1641
FutureWarning )
1642
1642
reset_option ("^display\." )
1643
1643
1644
-
1644
+ _initial_defencoding = None
1645
1645
def detect_console_encoding ():
1646
1646
"""
1647
1647
Try to find the most capable encoding supported by the console.
1648
1648
slighly modified from the way IPython handles the same issue.
1649
1649
"""
1650
1650
import locale
1651
+ global _initial_defencoding
1651
1652
1652
1653
encoding = None
1653
1654
try :
@@ -1664,6 +1665,11 @@ def detect_console_encoding():
1664
1665
if not encoding or 'ascii' in encoding .lower (): # when all else fails. this will usually be "ascii"
1665
1666
encoding = sys .getdefaultencoding ()
1666
1667
1668
+ # GH3360, save the reported defencoding at import time
1669
+ # MPL backends may change it. Make available for debugging.
1670
+ if not _initial_defencoding :
1671
+ _initial_defencoding = sys .getdefaultencoding ()
1672
+
1667
1673
return encoding
1668
1674
1669
1675
You can’t perform that action at this time.
0 commit comments