Build error: shutil.move(...) in cargo_wrapper.py results in AttributeError
The last line of cargo_wrapper.py is shutil.move(f, uninstalled)
. For Python3.8 this results in the error:
Traceback (most recent call last):
File "/home/user/temp/gstreamer/subprojects/gst-plugins-rs/cargo_wrapper.py", line 140, in <module>
shutil.move(f, uninstalled)
File "/usr/lib/python3.8/shutil.py", line 787, in move
real_dst = os.path.join(dst, _basename(src))
File "/usr/lib/python3.8/shutil.py", line 750, in _basename
return os.path.basename(path.rstrip(sep))
AttributeError: 'PosixPath' object has no attribute 'rstrip'
The reason in that shutil.move(...)
supports path copies from Python 3.9 on, and I am using Python3.8 for which shutil.move(..)
only supports string arguments (see shutil.move(...) documentation).
I will upload a commit shortly that checks the python version and that uses shutil.move(str(f), str(uninstalled))
for Python3.8 and older.
Edited by Klaas Jan Russcher