~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: John Arbash Meinel
  • Date: 2006-07-03 18:51:47 UTC
  • mto: This revision was merged to the branch mainline in revision 1851.
  • Revision ID: john@arbash-meinel.com-20060703185147-5097a3ba5310cd2c
On Mac we get EINVAL when renaming cwd

Show diffs side-by-side

added added

removed removed

Lines of Context:
264
264
    try:
265
265
        fancy_rename(old, new, rename_func=os.rename, unlink_func=os.unlink)
266
266
    except OSError, e:
267
 
        if e.errno in (errno.EPERM, errno.EACCES, errno.EBUSY):
268
 
            # If we try to rename a non-existant file onto cwd, we get EPERM
269
 
            # instead of ENOENT, this will raise ENOENT if the old path
270
 
            # doesn't exist
 
267
        if e.errno in (errno.EPERM, errno.EACCES, errno.EBUSY, errno.EINVAL):
 
268
            # If we try to rename a non-existant file onto cwd, we get 
 
269
            # EPERM or EACCES instead of ENOENT, this will raise ENOENT 
 
270
            # if the old path doesn't exist, sometimes we get EACCES
 
271
            # On Linux, we seem to get EBUSY, on Mac we get EINVAL
271
272
            os.lstat(old)
272
273
        raise
273
274