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:
parent
77513a2498
commit
eb23f8906d
1 changed files with 3 additions and 1 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Reference in a new issue