Merge lp://staging/~mascha/sbackup/trunkFixFor632605 into lp://staging/sbackup
Proposed by
Martin Schaaf
Status: | Merged |
---|---|
Merged at revision: | 196 |
Proposed branch: | lp://staging/~mascha/sbackup/trunkFixFor632605 |
Merge into: | lp://staging/sbackup |
Diff against target: |
111 lines (+28/-7) 5 files modified
src/sbackup/ar_backend/tar.py (+3/-5) src/sbackup/fs_backend/_fuse_utils.py (+7/-1) src/sbackup/fs_backend/_gio_utils.py (+9/-1) src/sbackup/util/exceptions.py (+5/-0) src/sbackup/util/interfaces.py (+4/-0) |
To merge this branch: | bzr merge lp://staging/~mascha/sbackup/trunkFixFor632605 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jean-Peer Lorenz | Approve | ||
Martin Schaaf | Pending | ||
Review via email: mp+38763@code.staging.launchpad.net |
This proposal supersedes a proposal from 2010-10-04.
To post a comment you must log in.
Thank you so much. I really appreciate your help.
Before merging your branch I've a few comments that need fixing though:
* don't import sys. Please use (more simple and intuitive): error(_ ("message: %s" % error)
...
except FileAccessError, error:
log.
* use logger.error instead of logger.warning
* please re-raise an exception within the close_stream methods. Use the same exception in both backends. Purpose is to decide outside (i.e. when using close_stream) whether or not we want to ignore errors, how to handle them etc. This could be done by translating *some* caught errors into well defined one. Maybe it's worth to declare a new custom exception. Just have a look into 'utils.exception' at the FileAccessError section and propose one. E.g. in fuse_utils:
... (_("Error while closing stream: %s") % error)
except (IOError, OSError), error:
raise FileAccessError
Similar for gio_utils (gio.Error and glib.Error). Just have a look at similar methods.
* please don't catch *all* exceptions. This is bad style. Catch only exceptions meaningful in the specific context. That is IOError and OSError in fuse backend and gio.Error and glib.Error in gio backend.
* catch according exception in module tar (line ~820) and log a message. I really don't like the idea of catching errors on stream closing in general.
* be sure your code complys to Python conventions: spaces instead of tabs, variable names at least 3 characters long, no camel case (I know, there are lots of not compliant LOC though I try to improve code quality whenever possible.) Use pylint if you want.