Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!1.eu.feeder.erje.net!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.057 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'locale': 0.07; 'override': 0.07; 'url:msdn': 0.07; '(actually': 0.09; 'lang': 0.09; 'python': 0.11; '"this': 0.13; '(but': 0.15; 'registry': 0.16; 'subject:windows': 0.16; 'unittests': 0.16; 'settings': 0.20; 'windows': 0.20; 'portion': 0.20; 'affects': 0.22; 'tried': 0.24; 'run': 0.32; 'probably': 0.32; 'windows.': 0.33; 'another': 0.34; 'thanks!': 0.34; 'subject:?': 0.34; 'to:addr:python-list': 0.35; 'subject:skip:p 10': 0.35; 'but': 0.36; 'url:library': 0.36; 'hi,': 0.37; 'setting': 0.37; 'charset:us-ascii': 0.37; 'version': 0.38; 'does': 0.39; 'url:microsoft': 0.39; 'to:addr:python.org': 0.39; 'easily': 0.39; 'more': 0.62; 'regional': 0.63; 'goal': 0.64; 'importantly,': 0.66; 'url:en-us': 0.66; 'received:98.137': 0.67; 'received:98.136': 0.70; 'received:gq1.yahoo.com': 0.72; 'received:mail.gq1.yahoo.com': 0.72; 'sounds': 0.72; 'received:bullet.mail.gq1.yahoo.com': 0.84; 'route': 0.84; 'panel.': 0.93 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 593740.51911.bm@omp1043.mail.gq1.yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1432471803; bh=H9Sc3VhLhTPHCfPfYMe72SmQWP145zGZ3yHuK6ihKTA=; h=Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=hfe33ccbLvBQu1F+D9G537zYIskt+ZHA//IVRlLY8V/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luZyBvbmx5IGFmZmVjdHMgdGhlIHVzZXIgb3ZlcnJpZGUgcG9ydGlvbiBvZiB0aGUBMAEBAQE- X-Mailer: YahooMailWebService/0.8.203.740 Date: Sun, 24 May 2015 05:50:03 -0700 From: Albert-Jan Roskam Subject: programmatically change windows regional settings? To: python-list@python.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1432471921 news.xs4all.nl 2910 [2001:888:2000:d::a6]:39544 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:91175 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