@@ -1171,17 +1171,19 @@ def move(self, src_path, dst_path, overwrite=False, preserve_time=False):
1171
1171
``dst_path`` does not exist.
1172
1172
1173
1173
"""
1174
- if not overwrite and self .exists (dst_path ):
1174
+ _src_path = self .validatepath (src_path )
1175
+ _dst_path = self .validatepath (dst_path )
1176
+ if not overwrite and self .exists (_dst_path ):
1175
1177
raise errors .DestinationExists (dst_path )
1176
- if self .getinfo (src_path ).is_dir :
1178
+ if self .getinfo (_src_path ).is_dir :
1177
1179
raise errors .FileExpected (src_path )
1178
- if normpath ( src_path ) == normpath ( dst_path ) :
1180
+ if _src_path == _dst_path :
1179
1181
# early exit when moving a file onto itself
1180
1182
return
1181
1183
if self .getmeta ().get ("supports_rename" , False ):
1182
1184
try :
1183
- src_sys_path = self .getsyspath (src_path )
1184
- dst_sys_path = self .getsyspath (dst_path )
1185
+ src_sys_path = self .getsyspath (_src_path )
1186
+ dst_sys_path = self .getsyspath (_dst_path )
1185
1187
except errors .NoSysPath : # pragma: no cover
1186
1188
pass
1187
1189
else :
@@ -1191,15 +1193,15 @@ def move(self, src_path, dst_path, overwrite=False, preserve_time=False):
1191
1193
pass
1192
1194
else :
1193
1195
if preserve_time :
1194
- copy_modified_time (self , src_path , self , dst_path )
1196
+ copy_modified_time (self , _src_path , self , _dst_path )
1195
1197
return
1196
1198
with self ._lock :
1197
- with self .open (src_path , "rb" ) as read_file :
1199
+ with self .open (_src_path , "rb" ) as read_file :
1198
1200
# FIXME(@althonos): typing complains because open return IO
1199
- self .upload (dst_path , read_file ) # type: ignore
1201
+ self .upload (_dst_path , read_file ) # type: ignore
1200
1202
if preserve_time :
1201
- copy_modified_time (self , src_path , self , dst_path )
1202
- self .remove (src_path )
1203
+ copy_modified_time (self , _src_path , self , _dst_path )
1204
+ self .remove (_src_path )
1203
1205
1204
1206
def open (
1205
1207
self ,
0 commit comments