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

Commitb124104

Browse files
committed
Fix Utils.pm's locale-munging so that Perl itself is also affected.
Utils.pm has a BEGIN block that editorializes on the locale-relatedenvironment variables, primarily in order to stabilize the behaviorof child programs. It turns out that if the calling test scripthas already done "use locale", this fails to affect the behaviorof Perl itself, causing locale behavior to be different betweenPerl and child programs. That breaks commitcd82e5c's attemptto deal with locale-specific behavior in psql.To fix, we just need to call setlocale() to redo the calculationof locale.Per report from Aleksander Alekseev. No back-patch for now, sincethere are no locale-dependent TAP tests in prior branches, andI'm not yet convinced that this won't have side-effects of its own.Discussion:https://postgr.es/m/CAJ7c6TO9KpYYxoVVseWEQB5KtjWDkt8NfyAeKPcHoe2Jq+ykpw@mail.gmail.com
1 parent363e8f9 commitb124104

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎src/test/perl/PostgreSQL/Test/Utils.pm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ use File::Spec;
5555
use File::statqw(stat);
5656
use File::Temp ();
5757
use IPC::Run;
58+
use POSIXqw(locale_h);
5859
use PostgreSQL::Test::SimpleTee;
5960

6061
# We need a version of Test::More recent enough to support subtests
@@ -103,6 +104,7 @@ BEGIN
103104
delete$ENV{LANGUAGE};
104105
delete$ENV{LC_ALL};
105106
$ENV{LC_MESSAGES} ='C';
107+
setlocale(LC_ALL,"");
106108

107109
# This list should be kept in sync with pg_regress.c.
108110
my@envkeys =qw (

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp