Author: phd
Date: Mon Oct 14 11:16:48 2013
New Revision: 4675
Log:
Stop supporting Python 2.4; use hashlib instead of md5
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/docs/TODO.txt
SQLObject/trunk/docs/test.py
SQLObject/trunk/sqlobject/include/hashcol.py
SQLObject/trunk/sqlobject/main.py
SQLObject/trunk/sqlobject/tests/test_md5.py
Modified: SQLObject/trunk/docs/News.txt
==============================================================================
--- SQLObject/trunk/docs/News.txt Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/docs/News.txt Mon Oct 14 11:16:48 2013 (r4675)
@@ -10,6 +10,12 @@
SQLObject (trunk)
=================
+Features & Interface
+--------------------
+
+* Python 2.4 is no longer supported. The minimal supported version is
+ Python 2.5.
+
SQLObject 1.5.0
===============
Modified: SQLObject/trunk/docs/TODO.txt
==============================================================================
--- SQLObject/trunk/docs/TODO.txt Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/docs/TODO.txt Mon Oct 14 11:16:48 2013 (r4675)
@@ -45,8 +45,6 @@
* Cache columns in sqlmeta.getColumns(); reset the cache on add/del Column/Join.
-* Stop supporting Python 2.4: use hashlib instead of md5.
-
* Stop supporting Python 2.5: remove import sets; use ``with lock``;
make ConnectionHub a context manager instead of .doInTransaction().
Modified: SQLObject/trunk/docs/test.py
==============================================================================
--- SQLObject/trunk/docs/test.py Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/docs/test.py Mon Oct 14 11:16:48 2013 (r4675)
@@ -1,9 +1,5 @@
import sys, os
-
-if sys.version_info >= (2, 4):
- import doctest
-else:
- raise ImportError("Python 2.4 doctest required")
+import doctest
sys.path.insert(
0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
Modified: SQLObject/trunk/sqlobject/include/hashcol.py
==============================================================================
--- SQLObject/trunk/sqlobject/include/hashcol.py Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/sqlobject/include/hashcol.py Mon Oct 14 11:16:48 2013 (r4675)
@@ -42,7 +42,7 @@
def __init__( self, **kw ):
if 'hashMethod' not in kw:
- from md5 import md5
+ from hashlib import md5
self.hashMethod = lambda v: md5( v ).hexdigest()
if 'length' not in kw:
kw['length'] = 32
Modified: SQLObject/trunk/sqlobject/main.py
==============================================================================
--- SQLObject/trunk/sqlobject/main.py Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/sqlobject/main.py Mon Oct 14 11:16:48 2013 (r4675)
@@ -43,8 +43,8 @@
from util.threadinglocal import local
import sys
-if sys.version_info[:3] < (2, 4, 0):
- raise ImportError, "SQLObject requires Python 2.4.0 or later"
+if sys.version_info[:3] < (2, 5, 0):
+ raise ImportError, "SQLObject requires Python 2.5.0 or later"
"""
This thread-local storage is needed for RowCreatedSignals. It gathers
@@ -648,8 +648,8 @@
if warnings_level is not None and warnings_level <= level:
warnings.warn(message, DeprecationWarning, stacklevel=stacklevel)
-if sys.version_info[:3] < (2, 5, 0):
- deprecated("Support for Python 2.4 has been declared obsolete and will be removed in the next release of SQLObject")
+#if sys.version_info[:3] < (2, 5, 0):
+# deprecated("Support for Python 2.4 has been declared obsolete and will be removed in the next release of SQLObject")
def setDeprecationLevel(warning=1, exception=None):
"""
Modified: SQLObject/trunk/sqlobject/tests/test_md5.py
==============================================================================
--- SQLObject/trunk/sqlobject/tests/test_md5.py Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/sqlobject/tests/test_md5.py Mon Oct 14 11:16:48 2013 (r4675)
@@ -1,7 +1,7 @@
-from md5 import md5
+from hashlib import md5
########################################
-## md5.md5
+## hashlib.md5
########################################
def test_md5():
|