1
0
Fork 0

terrasync.py: use os.path.abspath() in TerraSync.setTarget()

Using os.path.abspath() here in TerraSync.setTarget() adds a safety
layer in case the process later calls os.chdir() or similar[1], which
would change the meaning of the "." directory. Also remove the strip()
call which I don't consider useful here, see my message at:

  https://sourceforge.net/p/flightgear/mailman/message/36208140/

[1] Not the case currently, but who knows what will happen in the
    future...
This commit is contained in:
Florent Rougon 2018-02-03 11:12:27 +01:00
parent 77513a2498
commit eb23f8906d

View file

@ -507,7 +507,9 @@ class TerraSync:
return self
def setTarget(self, target):
self.target = target.rstrip('/').strip()
# Using os.path.abspath() here is safer in case the process later uses
# os.chdir(), which would change the meaning of the "." directory.
self.target = os.path.abspath(target)
return self
def start(self):