thank you post the patch!
the full source code about path i haven't seen,
but i want give a suggestion about it:
can we use unicode for path string?
this software may use in diff countries, so under the diff language env os,
for example i have found some people talk about it, but sometimes no one can explane this
so, some of them abandon FreeCAD,
i think this is a big problem...