Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.159 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.72; '*S*': 0.04; 'win32': 0.03; 'output': 0.05; 'locale': 0.09; 'none)': 0.09; 'python': 0.11; '(none,': 0.16; 'list)': 0.16; 'notation': 0.16; 'bit': 0.19; '>>>': 0.22; 'import': 0.22; 'skip:l 30': 0.24; 'question': 0.24; '2010,': 0.27; 'skip:( 20': 0.30; '"")': 0.31; 'but': 0.35; 'idle': 0.36; 'instances': 0.36; 'done': 0.36; 'hi,': 0.36; 'system,': 0.38; 'thank': 0.38; 'nov': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'received:98.137': 0.60; 'more': 0.64; 'different': 0.65; 'subject:. ': 0.67; 'header:Reply-To:1': 0.67; 'received:gq1.yahoo.com': 0.68; 'received:mail.gq1.yahoo.com': 0.68; 'received:98.136': 0.69; 'apart': 0.72; '2.7.1': 0.84; 'received:bullet.mail.gq1.yahoo.com': 0.84; 'subject:skip:l 10': 0.84; 'us?': 0.84; 'medicine,': 0.91; 'education,': 0.96 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1415611323; bh=ODg+g+WHnato5cLbugNXow6fN1vGxpJKlS+qO5M8mWY=; h=Date:From:Reply-To:To:Subject:From:Subject; b=BizMQas3QXk5q3yBz0ttQQ0K2EF31w3/CrNudMzu37UVZpppJ6wLrOPnVXATDCGxgpeAwAGJqavVuvXvrUVSRP6nLXnFrKjsH+40CthIya5gpEZtCQ868gGgR+IojdeeLFMs0tCV/PuDXbQnM/5JOB4cI5U6LvYS0ObudNjl0ZLwlYSx6HwoBnfSSoQLJxEQHGSRdPVkXnPD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bSblgLqn7uZTVCnbiikUavx_UVC__ZqXAaH9UGMHg3SIBEpz2POa64RHwjsd8- Date: Mon, 10 Nov 2014 09:22:03 +0000 (UTC) From: Albert-Jan Roskam To: Python Subject: locale.getlocale() in cmd.exe vs. Idle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Albert-Jan Roskam List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 50 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1415611526 news.xs4all.nl 2899 [2001:888:2000:d::a6]:40325 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80454 Hi, Why do I get different output for locale.getlocale() in Idle vs. cmd.exe? # IDLE Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> import locale >>> locale.getdefaultlocale() ('nl_NL', 'cp1252') >>> locale.getlocale() ('Dutch_Netherlands', '1252') # I need this specific notation >>> # cmd.exe or Ipython C:\Users\albertjan>python Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.getdefaultlocale() ('nl_NL', 'cp1252') >>> locale.getlocale() (None, None) # using setlocale does work (one of these instances when I answer my own question while writing to the Python list) C:\Users\albertjan>python Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.setlocale(locale.LC_ALL, "") 'Dutch_Netherlands.1252' >>> locale.getlocale() ('Dutch_Netherlands', '1252') Thank you! Regards, Albert-Jan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~