From fc640ec3a6f40a3c0df2596b32ddab39a573f176 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Thu, 6 Oct 2016 15:26:23 -0700 Subject: open() function does not support setting file permissions The open() function does not support setting file permissions[1]. The code was setting the buffer to 0o600. Remove the attempted file permission value. [1] https://docs.python.org/2/library/functions.html#open Change-Id: I582e226f8bc76e877c7da686f36e2efa33f0d24f --- paramiko/pkey.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'paramiko/pkey.py') diff --git a/paramiko/pkey.py b/paramiko/pkey.py index e95d60ba..7f32c8a5 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -318,8 +318,7 @@ class PKey (object): :raises IOError: if there was an error writing the file. """ - with open(filename, 'w', o600) as f: - # grrr... the mode doesn't always take hold + with open(filename, 'w') as f: os.chmod(filename, o600) self._write_private_key(tag, f, data, password) -- cgit v1.2.1