[Sugar-devel] [PATCH] Wrong exception when copying an entry with no file to a removable device.

Gonzalo Odiard godiard at gmail.com
Sun Jun 13 20:52:22 EDT 2010


Andres! Gol de Uruguay?

Gonzalo

On Sun, Jun 13, 2010 at 9:49 PM, Michael Stone <michael at laptop.org> wrote:

> 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
> >--- a/src/jarabe/journal/model.py
> >+++ b/src/jarabe/journal/model.py
> >@@ -492,7 +492,7 @@ def write(metadata, file_path='', update_mtime=True,
> transfer_ownership=True):
> >                                                  file_path,
> >                                                  transfer_ownership)
> >     else:
> >-        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')
> >
> >--
> >1.6.3.3
>
> Reviewed-by: Michael Stone <michael at laptop.org>
>
> Looks good to me; merged into my personal tree.
>
> Michael
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>



-- 
Gonzalo Odiard
Responsable de Desarrollo
Sistemas Australes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100613/aea4e7b3/attachment.htm 


More information about the Sugar-devel mailing list