8614: pickleupgrade.txt should not be written for python2

This commit is contained in:
kulath 2015-06-18 20:25:33 +01:00
parent 5828dd3aa8
commit e71115af1b

View File

@ -2471,16 +2471,14 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
with open(versionpath, "w") as version_file: with open(versionpath, "w") as version_file:
version_file.write(version) version_file.write(version)
versionpath = os.path.join(name, cuni(PCKVERSFN)) # The pickle upgrade file is not written for Python2; its contents is
with open(versionpath, "w") as version_file: # never actually examined, all that matters is whether it is present
if sys.version_info[0] <3: if sys.version_info[0] >= 3:
version = "No" versionpath = os.path.join(name, cuni(PCKVERSFN))
if isinstance(version, UNITYPE):
version = version.encode('utf-8')
else:
version = "Yes"
_LOG.debug("Write pickle version file to %s" % "Yes") _LOG.debug("Write pickle version file to %s" % "Yes")
version_file.write(version) with open(versionpath, "w") as version_file:
version = "Yes"
version_file.write(version)
versionpath = os.path.join(name, cuni(SCHVERSFN)) versionpath = os.path.join(name, cuni(SCHVERSFN))
_LOG.debug("Write schema version file to %s" % str(_DBVERSION)) _LOG.debug("Write schema version file to %s" % str(_DBVERSION))