<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">This Python code:<div><br></div><div><div><div>    #!/usr/bin/env python</div><div>    # encoding: utf-8</div><div><br></div><div>    import sys</div><div>    import os</div><div>    import locale</div><div><br></div><div>    def main():</div><div>        print locale.setlocale(locale.LC_ALL, '')</div><div>        print locale.format("%d", 282929992, grouping=True)</div><div><br></div><div>    if __name__ == '__main__':</div><div>        main()</div><div><br></div><div>produces the expected result when run under Python 2.5.2 from bash shell on Mac OS X:</div><div><br></div><div><span class="Apple-tab-span" style="white-space: pre; ">     </span>en_US.UTF-8</div><div><div><span class="Apple-tab-span" style="white-space: pre; ">    </span>282,929,992</div><div><br></div></div><div>and this unexpected result when run from PyMate:</div><div><pre><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-style-span" style="white-space: normal; "><span class="Apple-tab-span" style="white-space: pre; ">    </span>PyMate r8111 running Python 2.5.2 (/usr/bin/env python) >>> loc.py</span></font></pre></div><div><div><span class="Apple-tab-span" style="white-space: pre; ">      </span>C/en_US.UTF-8/C/C/C/C</div><div><span class="Apple-tab-span" style="white-space: pre; ">     </span>282929992</div><div><br></div><div>Notice that the integer is formatted into comma-separated groups when run from the shell, but not when run from PyMate.</div><div><br></div><div>Changing this line:<span class="Apple-tab-span" style="white-space: pre; "></span></div><div><br></div><div>        print locale.setlocale(locale.LC_ALL, '')</div><div><br></div><div>to this: </div><div><br></div><div>        print locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')</div><div><br></div><div>gives the expected results in PyMate.</div><div><br></div><div><br></div><div>Dave</div></div></div></div></body></html>