Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.05; 'locale': 0.07; 'override': 0.07; 'url:msdn': 0.07; '(actually': 0.09; 'lang': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; '"this': 0.13; '(but': 0.15; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'registry': 0.16; 'subject:windows': 0.16; 'unittests': 0.16; 'wrote:': 0.16; 'language': 0.19; 'settings': 0.20; 'windows': 0.20; 'portion': 0.20; 'affects': 0.22; 'lawrence': 0.22; 'tried': 0.24; 'header:In-Reply-To:1': 0.24; 'header:User- Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'helpful.': 0.29; 'url:mailman': 0.31; 'run': 0.32; 'probably': 0.32; 'language.': 0.32; 'possibly': 0.32; 'url:python': 0.33; 'windows.': 0.33; 'another': 0.34; 'thanks!': 0.34; 'subject:?': 0.34; 'url:listinfo': 0.35; 'to:addr:python-list': 0.35; 'subject:skip:p 10': 0.35; 'asking': 0.35; 'but': 0.36; 'url:org': 0.36; 'statement': 0.36; 'url:library': 0.36; 'hi,': 0.37; 'setting': 0.37; 'subject:: ': 0.37; 'skip:g 20': 0.37; 'rather': 0.38; 'version': 0.38; 'received:org': 0.38; 'does': 0.39; 'url:microsoft': 0.39; 'to:addr:python.org': 0.39; 'easily': 0.39; 'mark': 0.40; 'your': 0.60; 'here.': 0.61; 'more': 0.62; 'regional': 0.63; 'goal': 0.64; 'our': 0.64; 'charset:windows-1252': 0.65; 'importantly,': 0.66; 'python-list': 0.66; 'url:en-us': 0.66; 'sounds': 0.72; 'pythonistas,': 0.84; 'route': 0.84; 'lucky': 0.93; 'panel.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: programmatically change windows regional settings? Date: Sun, 24 May 2015 14:07:37 +0100 References: <1432471803.77701.BPMail_high_carrier@web163802.mail.gq1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-92-19-188-215.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: <1432471803.77701.BPMail_high_carrier@web163802.mail.gq1.yahoo.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list 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: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432472880 news.xs4all.nl 2841 [2001:888:2000:d::a6]:42837 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91176 On 24/05/2015 13:50, Albert-Jan Roskam via Python-list wrote: > > Hi, > > In Windows I can change the regional settings manually in the control panel. But how do I do this programmatically? I tried setting LANG but this does not work in Windows. > > Kernel32's SetLocaleInfo sounds promising, but "This setting only affects the user override portion of the locale settings; it does not set the system defaults." https://msdn.microsoft.com/en-us/library/ee491893(v=winembedded.60).aspx > > Another route might be _winreg (but that's probably more brittle and, more importantly, the registry sucks) > > My goal is to easily run my unittests in a number of locales (actually a platform x locale x python version matrix) > > Thanks! > > Albert-Jan > You're probably better off asking this on https://mail.python.org/mailman/listinfo/python-win32 which is also available as gmane.comp.python.windows, although you might get lucky here. If you do a rather more specific statement than "this does not work in Windows" would be helpful. Your Python and Windows version(s) might possibly assist as well :) -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence