From cc838c76ab8843b72cea73627dd0ed41890f3094 Mon Sep 17 00:00:00 2001 From: rwallen Date: Sat, 8 Jul 2017 10:24:48 -0700 Subject: Fixed issue on windows with engine-boots not properly being written. (#64) --- pysnmp/entity/engine.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pysnmp/entity') diff --git a/pysnmp/entity/engine.py b/pysnmp/entity/engine.py index b480de17..c7a10ebc 100644 --- a/pysnmp/entity/engine.py +++ b/pysnmp/entity/engine.py @@ -5,6 +5,7 @@ # License: http://pysnmp.sf.net/license.html # import os +import shutil import sys import tempfile from pyasn1.compat.octets import str2octs @@ -132,7 +133,7 @@ class SnmpEngine(object): fd, fn = tempfile.mkstemp(dir=persistentPath) os.write(fd, str2octs(snmpEngineBoots.syntax.prettyPrint())) os.close(fd) - os.rename(fn, f) + shutil.move(fn, f) except Exception: debug.logger & debug.flagApp and debug.logger( 'SnmpEngine: could not stored SNMP Engine Boots: %s' % sys.exc_info()[1]) -- cgit v1.2.1