[Calypso] [PATCH 1/4] Don't validate when sending data back to the user.

Guido Günther agx at sigxcpu.org
Mon May 16 02:04:27 PDT 2016


On Sun, May 15, 2016 at 10:35:29PM +0000, Jelmer Vernooij wrote:
> From: Jelmer Vernooij <jelmer at jelmer.uk>
> 
> The alternative is raising an exception here or hiding the item
> altogether.
> ---
>  calypso/webdav.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/calypso/webdav.py b/calypso/webdav.py
> index 0299c7a..0c59cc7 100644
> --- a/calypso/webdav.py
> +++ b/calypso/webdav.py
> @@ -163,7 +163,7 @@ class Item(object):
>          Text is the serialized form of the item.
>  
>          """
> -        return self.object.serialize().decode('utf-8')
> +        return self.object.serialize(validate=False).decode('utf-8')

How would we end up with items we can't serialize? If so shouldn't we
better catch the exception and then pass in validate=False and log an
error?
Cheers,
 -- Guido


More information about the Calypso mailing list