Description: (vila) Make .netrc 0600 in tests so python-2.7.5-8's netrc is happy.
  (Vincent Ladeuil)
Origin: commit, revision id: pqm@pqm.ubuntu.com-20131004093729-to7tbu9w6ws03wge
Author: Vincent Ladeuil <v.ladeuil+lp@free.fr>
Bug: https://launchpad.net/bugs/1233413
Debian-Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=723894
Last-Update: 2013-10-04
Applied-Upstream: merged in revision 6588
X-Bzr-Revision-Id: pqm@pqm.ubuntu.com-20131004093729-to7tbu9w6ws03wge

=== modified file 'bzrlib/plugins/netrc_credential_store/tests/test_netrc.py'
--- old/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py	2009-03-23 14:59:43 +0000
+++ new/bzrlib/plugins/netrc_credential_store/tests/test_netrc.py	2013-10-01 16:36:20 +0000
@@ -43,11 +43,12 @@
 machine host login joe password secret
 default login anonymous password joe@home
 """
-        f = open(osutils.pathjoin(self.test_home_dir, '.netrc'), 'wb')
-        try:
+        netrc_path = osutils.pathjoin(self.test_home_dir, '.netrc')
+        with open(netrc_path, 'wb') as f:
             f.write(netrc_content)
-        finally:
-            f.close()
+        # python's netrc will complain about access permissions starting with
+        # 2.7.5-8 so we restrict the access unconditionally
+        osutils.chmod_if_possible(netrc_path, 0600)
 
     def _get_netrc_cs(self):
         return  config.credential_store_registry.get_credential_store('netrc')


