In this paper, two sufficient and necessary conditions are given. The first one considers the boundary path groupoid of a topological graph without singular vertices, and it characterizes when the interior of its isotropy group bundle is closed. The second one concerns the path groupoid of a row-finite k-graph without sources, and it demonstrates when the interior of its isotropy is closed. It follows that the associated topological graph algebra and the associated k-graph C*-algebra have Cartan subalgebras due to a result of Brown–Nagy–Reznikoff–Sims–Williams.