There are some lines of code that join parent path to child path using string concatenation, this could create duplicate slash // as indicated in a50de51.
A more robust way using module functions such as pathlib.Path is needed to avoid generating illegal path. Moreover, it may be ideal to use pathlib module to handle every path modifications.