We are using the common string concatenation (with fstrings, e.g. f"path/{file}", or worse, with plus, e.g. "path/" + file) in many places of our codebase. We need to refactor everywhere we see something like this using the appropriate function, e.g. os.path.join("path", file) for these 2 reasons:
it is safer: no need to worry about slashes
it is crossplatform: this is not needed in our case, but it detects if the platform is Windows and uses backslashes instead of forward slashes to concatenate paths
We are using the common string concatenation (with fstrings, e.g.
f"path/{file}"
, or worse, with plus, e.g."path/" + file
) in many places of our codebase. We need to refactor everywhere we see something like this using the appropriate function, e.g.os.path.join("path", file)
for these 2 reasons: