byteface/domonic

Exception: unable to update parent 'Comment' object has no attribute 'args'

kthy opened this issue · 4 comments

kthy commented

When instantiating a domonic.html.comment (or a dom.Comment, same same) object in a Sanic response, I'm getting the exception unable to update parent 'Comment' object has no attribute 'args' (from dom.py line 193) seven to eleven times in my log. I can't reproduce it in a REPL session. I also can't figure out why I get any particular number of exceptions, but they are the same number from page load to page load.

@app.route("/test_comment")
async def test_comment(req):
    return response.html(f"{html(head(), body(comment('foo')))}")
[2021-10-11 12:39:04 +0200] [9197] [INFO] Starting worker [9197]
unable to update parent 'Comment' object has no attribute 'args'
unable to update parent 'Comment' object has no attribute 'args'
unable to update parent 'Comment' object has no attribute 'args'
unable to update parent 'Comment' object has no attribute 'args'
unable to update parent 'Comment' object has no attribute 'args'
unable to update parent 'Comment' object has no attribute 'args'
unable to update parent 'Comment' object has no attribute 'args'
unable to update parent 'Comment' object has no attribute 'args'
unable to update parent 'Comment' object has no attribute 'args'
unable to update parent 'Comment' object has no attribute 'args'
unable to update parent 'Comment' object has no attribute 'args'
[2021-10-11 12:39:15 +0200] [9197] [DEBUG] KeepAlive Timeout. Closing connection.

again apologies. I should have tested this way better.

I was trying to move away from the old fake comments onto proper DOM ones on the last few commits.

Will try to resolve asap. thanks for your feedback it's really great.

Hi. I think this was due to a change in 6.1 and you were using 6.0 at the time of this test. Please can you update to 6.2 and let me know if this still occurs. as I made a unit test to catch the behaviour but can't recreate so think it's due to the migration onto DOM nodes for comment tags. I will release 0.6.2 in a few minutes. then you should be able to use the --upgrade flag with pip install to get the latest and verify. If it still happens. Then I can try some other tests.

kthy commented

I can confirm that this issue is gone in 0.6.2.

@kthy thanks for the other 2 fixes also. I hope you don't mind but I added your name to the contributers.md