Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.6.6

Bug #17759 LC_ALL=C need to be set
Submitted: 2010-08-20 11:35 UTC
From: alec Assigned: gauthierm
Status: Closed Package: Crypt_GPG (version 1.1.1)
PHP Version: Irrelevant OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2010-08-20 11:35 UTC] alec (Aleksander Machniak)
Description: ------------ If LC_ALL is not set to C (or EN) gpg output is localized. Crypt_GPG only works with English. Simple fix: --- Engine.old 2010-08-20 09:27:04.818725258 +0200 +++ Engine.php 2010-08-20 09:26:47.962336699 +0200 @@ -1393,6 +1393,8 @@ if ($env === null) { $env = $_ENV; } + // re-set locale to get not-localized output from gpg + $env['LC_ALL'] = 'C'; $commandLine = $this->_binary;

Comments

 [2010-08-20 18:06 UTC] gauthierm (Michael Gauthier)
-Status: Open +Status: Closed -Assigned To: +Assigned To: gauthierm
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Fixed in revision 302557 (http://svn.php.net/viewvc?view=revision&revision=302557) I used setlocale and added code to reset to the old locale after Crypt_GPG is done so as not to break scripts that use locales.
 [2010-08-23 11:04 UTC] alec (Aleksander Machniak)
-Status: Closed +Status: Open
This change (302557) doesn't works for me. Also I don't think we need to save current locale and reset it after processing. As you see in _openSubprocess() the $env variable is local, so I think my first patch is ok. BTW, second argument in _openSubprocess() method is never used and could be removed.
 [2010-08-23 11:05 UTC] alec (Aleksander Machniak)
Sorry, not second ;), the first. There's only one argument in this method.
 [2010-08-23 17:03 UTC] gauthierm (Michael Gauthier)
Right, I forgot that the GnuPG process is a complete subprocess with its own environment. I will make this change.
 [2010-08-23 17:08 UTC] gauthierm (Michael Gauthier)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Fixed in revision 302701. http://svn.php.net/viewvc?view=revision&revision=302701