diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-08-31 15:22:00 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-08-31 15:22:00 -0400 |
commit | 3c60d3b1ca492ba77d64111f0378892acaadf36b (patch) | |
tree | 5e2df552a7142cd3bb2ef9e5236db85e5c2859f4 /lib/sqlalchemy/sql/schema.py | |
parent | 903b0a42e71c81ff99494352760c0f92fa7a486d (diff) | |
download | sqlalchemy-3c60d3b1ca492ba77d64111f0378892acaadf36b.tar.gz |
- A new style of warning can be emitted which will "filter" up to
N occurrences of a parameterized string. This allows parameterized
warnings that can refer to their arguments to be delivered a fixed
number of times until allowing Python warning filters to squelch them,
and prevents memory from growing unbounded within Python's
warning registries.
fixes #3178
Diffstat (limited to 'lib/sqlalchemy/sql/schema.py')
-rw-r--r-- | lib/sqlalchemy/sql/schema.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index c8e815d24..8225a3533 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -1124,8 +1124,12 @@ class Column(SchemaItem, ColumnClause): else: if getattr(self.type, '_warn_on_bytestring', False): if isinstance(self.default, util.binary_type): - util.warn("Unicode column received non-unicode " - "default value.") + util.warn( + "Unicode column '%s' has non-unicode " + "default value %r specified." % ( + self.key, + self.default + )) args.append(ColumnDefault(self.default)) if self.server_default is not None: |