warnings module saves all warning messages permanently ?!
need to confirm this is the case, and then need to remove all string interpolations from warnings, i.e. _warn_on_bytestring. We then need to prepare for all the user requests to put it back in.
Comments (7)
-
Account Deleted -
Account Deleted filter is applied only to suppress stdout spam, changes nothing
-
reporter confirmed:
def test_unicode_warnings(self): metadata = MetaData(testing.db) table1 = Table("mytable", metadata, Column('col1', Integer, primary_key=True, test_needs_autoincrement=True), Column('col2', Unicode(30))) metadata.create_all() i = [1](1) @testing.emits_warning() @profile_memory def go(): # execute with a non-unicode object. # a warning is emitted, this warning shouldn't # clog up memory. testing.db.execute(table1.select().where(table1.c.col2=='foo%d' % i[0](0))) i[0](0) += 1 try: go() finally: metadata.drop_all()
output:
sample gc sizes: [45496, 45497, 45498, 45499, 45500, 45501, 45502, 45503, 45504, 45505, 45506, 45507, 45508, 45509, 45510, 45511, 45512, 45513, 45514, 45515, 45516, 45517, 45518, 45519, 45520, 45521, 45522, 45523, 45524, 45525, 45526, 45527, 45528, 45529, 45530, 45531, 45532, 45533, 45534, 45535, 45536, 45537, 45538, 45539, 45540, 45541, 45542, 45543, 45544](45495,)
-
reporter - changed status to resolved
-
Account Deleted Would it be possible to print the column name instead in the warning? I often find myself trying to figure out where the problem is but without knowing which column it is that can be very cumbersome if you have long queries with many columns.
-
reporter Replying to guest:
Would it be possible to print the column name instead in the warning? I often find myself trying to figure out where the problem is but without knowing which column it is that can be very cumbersome if you have long queries with many columns.
unfortunately we don't have the column name available at that point. the usual method of squashing warnings is to set the warnings filter to raise an exception, at which point you get a full stack trace.
-
reporter - removed milestone
Removing milestone: 0.6.2 (automated comment)
- Log in to comment
Hi!
It was me, who posted that message in googlegroups. What questions do I need to answer? =)
Here's a simple test:
Please add nikita.vetoshkin@gmail.com to CC.