Skip Montanaro added the comment: Final note here. Peter also did a bit of digging. Here's his note about what he found on c.l.py:
The pager is invoked by os.popen(), and after some digging I find that it uses a io.TestIOWrapper() to write the help text. This in turn uses locale.getpreferredencoding(False), i. e. you were right to set LANG and PYTHONIOENCODING is not relevant. I was also able to provoke this problem on an openSuSE 12.2 system with 3.2.3 installed. In that environment (confirmed by Chris Angelico on his Linux system), the case of "utf" didn't matter, nor did it matter if "utf-8" was hyphenated or not. Obviously the Mac continues to be a rather touchy system w.r.t. locale. I don't know if Python should try to be accommodating here, but my inclination is "no". OTOH, maybe io.TestIOWrapper should look at PYTHONIOENCODING, or the pager should be invoked through something other than os.popen (assuming there is a suitable replacement which does pay attention to PYTHONIOENCODING). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23374> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com