When moving a file via the python os.rename function it is required to specify the path including the file name at the end. Failure to provide this file name at the destination argument of the os.rename function raises an OSError exception.
[YOCTO#8180] Signed-off-by: Benjamin Esquivel <[email protected]> --- bitbake/lib/bb/utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 5b94432..5ed8e01 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/lib/bb/utils.py @@ -741,7 +741,11 @@ def movefile(src, dest, newmtime = None, sstat = None): renamefailed = 1 if sstat[stat.ST_DEV] == dstat[stat.ST_DEV]: try: - os.rename(src, dest) + # os.rename needs to know the destination path with file name + srcfname = os.path.basename(src) + destfname = os.path.join(dest, srcfname) if os.path.isdir(dest) \ + else dest + os.rename(src, destfname) renamefailed = 0 except Exception as e: if e[0] != errno.EXDEV: -- 2.3.0 -- _______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
