[bitbake-devel] Slightly broken exception handling in bb.utils.movefile()

Phil Blundell pb at pbcl.net
Wed Oct 12 17:07:07 UTC 2016


This code:

        except Exception as e:
            if e[0] != errno.EXDEV:
                # Some random error.
                print("movefile: Failed to move", src, "to", dest, e)
                return None

doesn't seem to work any more (presumably since Python 3).  If you end
up with a PermissionDeniedError here then you get a runtime crash
because PermissionDeniedErrors aren't subscriptable.  

In fact I'm not sure the above was ever quite correct even with Python
2.  I assume that it ought to be a bit more like:

        except OSError as e:
            if e.errno != errno.EXDEV:

p.




More information about the bitbake-devel mailing list