If ``table_names`` creates the cursor, it is not explicitly closed. That will be corrected in a subsequent commit and then this ``with`` block will be removed.