@@ -116,8 +116,8 @@ def get_temp_dir():
116116
117117def path_join (base , * rest ):
118118 new_rest = []
119- for i in range ( len ( rest )) :
120- new_rest .append (str (rest [ i ] ))
119+ for r in rest :
120+ new_rest .append (str (r ))
121121
122122 rpath = '/' .join (new_rest )
123123
@@ -141,6 +141,14 @@ def get_data_path(dir_path):
141141
142142 return data_path
143143
144+ def abs_path (file_path ):
145+ path = os .path .abspath (file_path )
146+
147+ if is_windows ():
148+ path = path .replace ('/' , '\\ ' )
149+
150+ return path
151+
144152def get_data_file_path (file_path ):
145153 parts = file_path .split ('/' )
146154 data_path = get_data_path ('/' .join (parts [:- 1 ]))
@@ -170,9 +178,9 @@ def move(src, dest, **kwargs):
170178
171179def copytree (src , dest , ** kwargs ):
172180 if is_windows ():
173- if os .path .isabs (src ):
181+ if os .path .isabs (src ) and not src . startswith ( ' \\ \\ ' ) :
174182 src = '\\ \\ ?\\ ' + src .replace ('/' , '\\ ' )
175- if os .path .isabs (dest ):
183+ if os .path .isabs (dest ) and not dest . startswith ( ' \\ \\ ' ) :
176184 dest = '\\ \\ ?\\ ' + dest .replace ('/' , '\\ ' )
177185 shutil .copytree (src , dest , ** kwargs )
178186
0 commit comments