This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SQLObject development repository".
The branch, master has been updated
via 682d1e95bbefaa540483d23d6a849eab6e42cf38 (commit)
via 3ebe1ec5c7ddab3499625dc3b3b3145c949ec4e2 (commit)
via d5009b510c2faaa618e8035ec23120049d8ad921 (commit)
via eb9066fd575b8d007f2cc4bd6aa947cb646efae1 (commit)
via d153fda0f745d2968fdc6e19eb8f576b5752a8b9 (commit)
via e5ddaf070d61c7692835dfb666e507fc7cd42ec3 (commit)
from ed85db037fb956d542a14fa01c92a973941dd7b3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/sqlobject/sqlobject/ci/682d1e95bbefaa540483d23d6a849eab6e42cf38
commit 682d1e95bbefaa540483d23d6a849eab6e42cf38
Merge: 3ebe1ec d5009b5
Author: Oleg Broytman <ph...@ph...>
Date: Wed Feb 25 19:28:47 2015 +0300
Merge pull request #99 from drnlm/fix_test_constraints
Update test to python3 behaviour
http://sourceforge.net/p/sqlobject/sqlobject/ci/3ebe1ec5c7ddab3499625dc3b3b3145c949ec4e2
commit 3ebe1ec5c7ddab3499625dc3b3b3145c949ec4e2
Merge: ed85db0 eb9066f
Author: Oleg Broytman <ph...@ph...>
Date: Wed Feb 25 19:26:37 2015 +0300
Merge pull request #98 from drnlm/rework_blob_columns
Rework blob columns
http://sourceforge.net/p/sqlobject/sqlobject/ci/d5009b510c2faaa618e8035ec23120049d8ad921
commit d5009b510c2faaa618e8035ec23120049d8ad921
Author: Neil <drn...@gm...>
Date: Wed Feb 25 15:49:30 2015 +0200
Update test to python3 behaviour
diff --git a/sqlobject/tests/test_constraints.py b/sqlobject/tests/test_constraints.py
index 89a03fc..cddf247 100644
--- a/sqlobject/tests/test_constraints.py
+++ b/sqlobject/tests/test_constraints.py
@@ -12,8 +12,11 @@ def test_constraints():
col = Dummy(name='col')
isString(obj, col, 'blah')
raises(BadValue, isString, obj, col, 1)
- # @@: Should this really be an error?
- raises(BadValue, isString, obj, col, u'test!')
+ if sys.version_info[0] == 2:
+ # @@: Should this really be an error?
+ raises(BadValue, isString, obj, col, u'test!')
+ else:
+ raises(BadValue, isString, obj, col, b'test!')
# isString(obj, col, u'test!')
raises(BadValue, notNull, obj, col, None)
http://sourceforge.net/p/sqlobject/sqlobject/ci/eb9066fd575b8d007f2cc4bd6aa947cb646efae1
commit eb9066fd575b8d007f2cc4bd6aa947cb646efae1
Author: Neil <drn...@gm...>
Date: Wed Feb 25 13:55:46 2015 +0200
Update picklecol to expect bytes in python 3
diff --git a/sqlobject/col.py b/sqlobject/col.py
index fd8621d..28e5693 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -1752,7 +1752,7 @@ class PickleValidator(BinaryValidator):
if isinstance(value, unicode_type):
dbEncoding = self.getDbEncoding(state, default='ascii')
value = value.encode(dbEncoding)
- if isinstance(value, str):
+ if isinstance(value, bytes):
return pickle.loads(value)
raise validators.Invalid(
"expected a pickle string in the PickleCol '%s', "
http://sourceforge.net/p/sqlobject/sqlobject/ci/d153fda0f745d2968fdc6e19eb8f576b5752a8b9
commit d153fda0f745d2968fdc6e19eb8f576b5752a8b9
Author: Neil <drn...@gm...>
Date: Wed Feb 25 13:55:22 2015 +0200
Rework BinaryValidator to deal in bytes and handle memoryviews in python 3
diff --git a/sqlobject/col.py b/sqlobject/col.py
index 6a4670e..fd8621d 100644
--- a/sqlobject/col.py
+++ b/sqlobject/col.py
@@ -1671,6 +1671,8 @@ class BinaryValidator(SOValidator):
binaryType = connection._binaryType
if isinstance(value, str):
if dbName == "sqlite":
+ if sys.version_info[0] > 2:
+ value = bytes(value, 'ascii')
value = connection.module.decode(value)
return value
if isinstance(value, (buffer_type, binaryType)):
@@ -1679,6 +1681,8 @@ class BinaryValidator(SOValidator):
return cachedValue[0]
if isinstance(value, array): # MySQL
return value.tostring()
+ if sys.version_info[0] > 2 and isinstance(value, memoryview):
+ return value.tobytes()
return str(value) # buffer => string
raise validators.Invalid(
"expected a string in the BLOBCol '%s', got %s %r instead" % (
@@ -1689,6 +1693,8 @@ class BinaryValidator(SOValidator):
return None
connection = state.connection or state.soObject._connection
binary = connection.createBinary(value)
+ if sys.version_info[0] > 2 and isinstance(binary, memoryview):
+ binary = str(binary.tobytes(), 'ascii')
self._cachedValue = (value, binary)
return binary
http://sourceforge.net/p/sqlobject/sqlobject/ci/e5ddaf070d61c7692835dfb666e507fc7cd42ec3
commit e5ddaf070d61c7692835dfb666e507fc7cd42ec3
Author: Neil <drn...@gm...>
Date: Wed Feb 25 13:53:17 2015 +0200
Tweak test_blob to use bytes
diff --git a/sqlobject/tests/test_blob.py b/sqlobject/tests/test_blob.py
index c4cf566..584b2ad 100644
--- a/sqlobject/tests/test_blob.py
+++ b/sqlobject/tests/test_blob.py
@@ -1,3 +1,4 @@
+import sys
import py.test
from sqlobject import *
from sqlobject.tests.dbtest import *
@@ -9,14 +10,17 @@ from sqlobject.tests.dbtest import *
class ImageData(SQLObject):
- image = BLOBCol(default='emptydata', length=65535)
+ image = BLOBCol(default=b'emptydata', length=65535)
def test_BLOBCol():
if not supports('blobData'):
py.test.skip("blobData isn't supported")
setupClass(ImageData)
- data = ''.join([chr(x) for x in range(256)])
+ if sys.version_info[0] == 2:
+ data = ''.join([chr(x) for x in range(256)])
+ else:
+ data = bytes(range(256))
prof = ImageData()
prof.image = data
-----------------------------------------------------------------------
Summary of changes:
sqlobject/col.py | 8 +++++++-
sqlobject/tests/test_blob.py | 8 ++++++--
sqlobject/tests/test_constraints.py | 7 +++++--
3 files changed, 18 insertions(+), 5 deletions(-)
hooks/post-receive
--
SQLObject development repository
|