[Checkins] SVN: DateTime/trunk/ Add `_dt_reconstructor` function introduced in DateTime 2.12.7.

Hano Schlichting cvs-admin at zope.org
Mon Sep 17 21:16:49 UTC 2012


Log message for revision 127856:
  Add `_dt_reconstructor` function introduced in DateTime 2.12.7.
  

Changed:
  U   DateTime/trunk/CHANGES.txt
  U   DateTime/trunk/setup.py
  U   DateTime/trunk/src/DateTime/DateTime.py

-=-
Modified: DateTime/trunk/CHANGES.txt
===================================================================
--- DateTime/trunk/CHANGES.txt	2012-09-17 13:20:21 UTC (rev 127855)
+++ DateTime/trunk/CHANGES.txt	2012-09-17 21:16:44 UTC (rev 127856)
@@ -1,11 +1,17 @@
 Changelog
 =========
 
-3.1 (unreleased)
+3.0.1 (unreleased)
+------------------
+
+- Add `_dt_reconstructor` function introduced in DateTime 2.12.7 to provide
+  forward compatibility with pickles that might reference this function.
+
+3.0 (2011-12-09)
 ----------------
 
+- No changes.
 
-
 Backwards compatibility of DateTime 3
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -26,11 +32,6 @@
 used in comparing timestamps of file systems - use the time and datetime objects
 from the Python standard library instead.
 
-3.0 (2011-12-09)
-----------------
-
-- No changes.
-
 3.0b3 (2011-10-19)
 ------------------
 

Modified: DateTime/trunk/setup.py
===================================================================
--- DateTime/trunk/setup.py	2012-09-17 13:20:21 UTC (rev 127855)
+++ DateTime/trunk/setup.py	2012-09-17 21:16:44 UTC (rev 127856)
@@ -16,7 +16,7 @@
 from setuptools import setup, find_packages
 
 setup(name='DateTime',
-      version = '3.1dev',
+      version = '3.0.1dev',
       url='http://pypi.python.org/pypi/DateTime',
       license='ZPL 2.1',
       description="""\

Modified: DateTime/trunk/src/DateTime/DateTime.py
===================================================================
--- DateTime/trunk/src/DateTime/DateTime.py	2012-09-17 13:20:21 UTC (rev 127855)
+++ DateTime/trunk/src/DateTime/DateTime.py	2012-09-17 21:16:44 UTC (rev 127856)
@@ -11,6 +11,7 @@
 #
 ##############################################################################
 
+import copy_reg
 import math
 import re
 from time import altzone
@@ -1907,3 +1908,15 @@
         out.write('<value><dateTime.iso8601>')
         out.write(self.ISO8601())
         out.write('</dateTime.iso8601></value>\n')
+
+
+# Provide the _dt_reconstructor function here, in case something
+# accidentally creates a reference to this function
+
+orig_reconstructor = copy_reg._reconstructor
+
+
+def _dt_reconstructor(cls, base, state):
+    if cls is DateTime:
+        return cls(state)
+    return orig_reconstructor(cls, base, state)



More information about the checkins mailing list