Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit bc773b1

Browse files
committed
CI: Use LANG/LC_ALL/LANGUAGE also on Windows systems again
1 parent 4d13194 commit bc773b1

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ jobs:
1515
os: [ubuntu-latest, windows-latest]
1616
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
1717

18+
env:
19+
LANG: en_US.UTF-8
20+
LC_ALL: en_US.UTF-8
21+
LANGUAGE: en_US.UTF-8
1822
steps:
1923
- uses: actions/checkout@master
2024
- name: Set up Python ${{ matrix.python-version }}

cr8/run_crate.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ def __init__(self,
273273
java_home = os.environ.get('JAVA_HOME', '')
274274
self.env.setdefault('JAVA_HOME', java_home)
275275

276+
# Propagate charset encoding / code page information.
277+
self.env.setdefault('LANG',
278+
os.environ.get('LANG', os.environ.get('LC_ALL')))
279+
if not self.env['LANG']:
280+
raise SystemExit('Your locale are not configured correctly. '
281+
'Please set LANG or alternatively LC_ALL.')
282+
276283
# Operating system specific configuration.
277284
if sys.platform == "win32":
278285
start_script = 'crate.bat'
@@ -283,11 +290,6 @@ def __init__(self,
283290
self.env.setdefault('SystemRoot', 'C:\\Windows')
284291
else:
285292
start_script = 'crate'
286-
self.env.setdefault('LANG',
287-
os.environ.get('LANG', os.environ.get('LC_ALL')))
288-
if not self.env['LANG']:
289-
raise SystemExit('Your locale are not configured correctly. '
290-
'Please set LANG or alternatively LC_ALL.')
291293

292294
self.monitor = OutputMonitor()
293295
self.process = None # type: Optional[subprocess.Popen]

0 commit comments

Comments
 (0)