WEEE-Open / peracotta

Script to gather hardware data and update T.A.R.A.L.L.O. automatically
MIT License
2 stars 11 forks source link

Refactor path concatenation using os.path.join() #94

Closed e-caste closed 3 years ago

e-caste commented 3 years ago

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:

  1. it is safer: no need to worry about slashes
  2. 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
PulkitMishra commented 3 years ago

Hey @e-caste I could only find 2 such instances. Please check #95 Let me know if I missed out on any occurrences.