Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3eb7265

Browse files
committed
Ensure consistent output from git command
The git command output can vary by language which would cause assertionserrors when parsing the output.On POSIX system the language used by git can be adjusted by LC_MESSAGES.The special language 'C' is guaranteed to be always available and iswhatever default the software has been written in (usually english, thecase for git).Thus passing LC_MESSAGES to Popen will ensure we receive from git aconsistent output regardless of the user preference.Addressesgitpython-developers#153
1 parent27c577d commit3eb7265

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎git/cmd.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ def execute(self, command,
316316
if ouput_stream is True, the stdout value will be your output stream:
317317
* output_stream if extended_output = False
318318
* tuple(int(status), output_stream, str(stderr)) if extended_output = True
319+
320+
Note git is executed with LC_MESSAGES="C" to ensure consitent
321+
output regardless of system language.
319322
320323
:raise GitCommandError:
321324
@@ -333,6 +336,7 @@ def execute(self, command,
333336

334337
# Start the process
335338
proc=Popen(command,
339+
env={"LC_MESSAGES":"C"},
336340
cwd=cwd,
337341
stdin=istream,
338342
stderr=PIPE,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp