[Sugar-devel] [PATCH] Wrong exception when copying an entry with no file to a removable device.
andresambrois at gmail.com
Sun Jun 13 22:53:44 EDT 2010
On Sunday 13 June 2010 09:52:22 pm Gonzalo Odiard wrote:
> Andres! Gol de Uruguay?
For a change! ;)
Actually, I don't know if there's a ticket for this. I just ran into it while
looking at the code.
P.S.: Good thing that Germany - Australia was a little more exciting than the
rest of the world cup so far... lets hope we can ramp up the pace as well :)
> 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')
> > >
> > >--
> > >126.96.36.199
> > 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 --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100613/448f7bfd/attachment.pgp
More information about the Sugar-devel