diff options
author | rwallen <riverallen@gmail.com> | 2017-07-08 10:24:48 -0700 |
---|---|---|
committer | Ilya Etingof <etingof@gmail.com> | 2017-07-08 19:24:48 +0200 |
commit | cc838c76ab8843b72cea73627dd0ed41890f3094 (patch) | |
tree | 9f20e61a1ebb0c19d9d70c1f3605140631f708d7 /pysnmp/entity | |
parent | a28ac717925076dc0edba6a4cc0aed947f867a68 (diff) | |
download | pysnmp-git-cc838c76ab8843b72cea73627dd0ed41890f3094.tar.gz |
Fixed issue on windows with engine-boots not properly being written. (#64)
Diffstat (limited to 'pysnmp/entity')
-rw-r--r-- | pysnmp/entity/engine.py | 3 |
1 files changed, 2 insertions, 1 deletions
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]) |