summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-11-21 13:30:32 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2013-11-21 13:30:32 -0500
commit2aa00c49d7a1a783ff50832f2de7760bfaaccf6d (patch)
tree8cee77853374a0570c562e1b5510bb55da3290ce /lib/sqlalchemy
parent42fd77a4bfb8c5a1c02c89a17481a90cd039f10e (diff)
downloadsqlalchemy-2aa00c49d7a1a783ff50832f2de7760bfaaccf6d.tar.gz
- Fixed bug which prevented the ``serializer`` extension from working
correctly with table or column names that contain non-ASCII characters. [ticket:2869]
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/ext/serializer.py8
-rw-r--r--lib/sqlalchemy/sql/selectable.py2
-rw-r--r--lib/sqlalchemy/testing/assertions.py2
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/sqlalchemy/ext/serializer.py b/lib/sqlalchemy/ext/serializer.py
index 8abd1fdf3..672e077ad 100644
--- a/lib/sqlalchemy/ext/serializer.py
+++ b/lib/sqlalchemy/ext/serializer.py
@@ -58,7 +58,7 @@ from ..orm.interfaces import MapperProperty
from ..orm.attributes import QueryableAttribute
from .. import Table, Column
from ..engine import Engine
-from ..util import pickle, byte_buffer, b64encode, b64decode
+from ..util import pickle, byte_buffer, b64encode, b64decode, text_type
import re
@@ -80,9 +80,9 @@ def Serializer(*args, **kw):
id = "mapperprop:" + b64encode(pickle.dumps(obj.parent.class_)) + \
":" + obj.key
elif isinstance(obj, Table):
- id = "table:" + str(obj)
+ id = "table:" + text_type(obj.key)
elif isinstance(obj, Column) and isinstance(obj.table, Table):
- id = "column:" + str(obj.table) + ":" + obj.key
+ id = "column:" + text_type(obj.table.key) + ":" + text_type(obj.key)
elif isinstance(obj, Session):
id = "session:"
elif isinstance(obj, Engine):
@@ -112,7 +112,7 @@ def Deserializer(file, metadata=None, scoped_session=None, engine=None):
return None
def persistent_load(id):
- m = our_ids.match(str(id))
+ m = our_ids.match(text_type(id))
if not m:
return None
else:
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py
index 046840110..708103fc6 100644
--- a/lib/sqlalchemy/sql/selectable.py
+++ b/lib/sqlalchemy/sql/selectable.py
@@ -246,7 +246,7 @@ class FromClause(Selectable):
:param column: the target :class:`.ColumnElement` to be matched
:param require_embedded: only return corresponding columns for
- the given :class:`.ColumnElement`, if the given :class:`.ColumnElement`
+ the given :class:`.ColumnElement`, if the given :class:`.ColumnElement`
is actually present within a sub-element
of this :class:`.FromClause`. Normally the column will match if
it merely shares a common ancestor with one of the exported
diff --git a/lib/sqlalchemy/testing/assertions.py b/lib/sqlalchemy/testing/assertions.py
index 8a859c0b1..ebd1b424d 100644
--- a/lib/sqlalchemy/testing/assertions.py
+++ b/lib/sqlalchemy/testing/assertions.py
@@ -235,7 +235,7 @@ class AssertsCompiledSQL(object):
if util.py3k:
param_str = param_str.encode('utf-8').decode('ascii', 'ignore')
- print("\nSQL String:\n" + util.text_type(c) + param_str)
+ print("\nSQL String:\n" + util.text_type(c).encode('utf-8') + param_str)
cc = re.sub(r'[\n\t]', '', util.text_type(c))