[Sugar-devel] [PATCH] Wrong exception when copying an entry with no file to a removable device.
michael at laptop.org
Sun Jun 13 20:49:56 EDT 2010
On Sun, Jun 13, 2010 at 08:43:19PM -0300, Andrés Ambrois wrote:
>In that case write() was called with file_path=None by copy() and a
>TypeError was raised by os.path.exists().
>Signed-off-by: Andrés Ambrois <andresambrois at gmail.com>
> src/jarabe/journal/model.py | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
>index ae77e72..fd3d3db 100644
>@@ -492,7 +492,7 @@ def write(metadata, file_path='', update_mtime=True, transfer_ownership=True):
>- if not os.path.exists(file_path):
>+ if not file_path or not os.path.exists(file_path):
> raise ValueError('Entries without a file cannot be copied to '
> 'removable devices')
Reviewed-by: Michael Stone <michael at laptop.org>
Looks good to me; merged into my personal tree.
More information about the Sugar-devel