File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1862,9 +1862,30 @@ def rename(
18621862 # avoid calling .resolve for if not needed
18631863 if ".." in target_abs .parts or "." in target_abs .parts :
18641864 target_abs = target_abs .resolve ()
1865+ if kwargs :
1866+ warnings .warn (
1867+ "Passing additional keyword arguments to "
1868+ f"{ type (self ).__name__ } .rename() is deprecated and will be"
1869+ " removed in future univeral-pathlib versions." ,
1870+ DeprecationWarning ,
1871+ stacklevel = 2 ,
1872+ )
18651873 if recursive is not UNSET_DEFAULT :
1874+ warnings .warn (
1875+ f"{ type (self ).__name__ } .rename()'s `recursive` keyword argument is"
1876+ " deprecated and will be removed in future universal-pathlib versions."
1877+ f" Please use { type (self ).__name__ } .move() or .move_into() instead." ,
1878+ DeprecationWarning ,
1879+ stacklevel = 2 ,
1880+ )
18661881 kwargs ["recursive" ] = recursive
18671882 if maxdepth is not UNSET_DEFAULT :
1883+ warnings .warn (
1884+ f"{ type (self ).__name__ } .rename()'s `maxdepth` keyword argument is"
1885+ " deprecated and will be removed in future universal-pathlib versions." ,
1886+ DeprecationWarning ,
1887+ stacklevel = 2 ,
1888+ )
18681889 kwargs ["maxdepth" ] = maxdepth
18691890 self .fs .mv (
18701891 source_abs .path ,
You can’t perform that action at this time.
0 commit comments