[Flask] Ignored TypeError when my app is terminated

Gergely Polonkai gergely at polonkai.eu
Wed Jul 19 04:40:43 EDT 2017


Hello,

this is half Python, half Flask question. I have a relatively big Flask app
(closed source, but I can share bits of the code if needed). It uses
Celery, which I suspect as the source of my problem (I think it started
appearing when we began using it).

I have a relatively complex manage.py script, which utilizes Flask-Script.
At some, seemingly random, occasions, I get the following traceback when a
command finishes:

Exception ignored in: <function
WeakValueDictionary.__init__.<locals>.remove at 0x7f8f4fd2df28>
Traceback (most recent call last):
  File "/usr/lib64/python3.5/weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable
Exception ignored in: <function
WeakValueDictionary.__init__.<locals>.remove at 0x7f8f4fd2df28>
Traceback (most recent call last):
  File "/usr/lib64/python3.5/weakref.py", line 117, in remove
TypeError: 'NoneType' object is not callable

I know such ignored exceptions can happen after a script exits, while
Python is destructing all the objects in memory. However, with such a stack
trace, it’s pretty hard to find what is exactly causing the problem.

Do any of you have an idea how to get to the bottom of this?

Best,
Gergely
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20170719/169ab363/attachment.html>


More information about the Flask mailing list