Re: Where to catch FileTooLong error

Thomas Waldmann <[email protected]> Tue, 14 Oct 2014 18:26:37 +0200
Newsgroups gmane.comp.web.wiki.moin.general
Message-ID <[email protected]>
Hi Nikolaus,

> How about this patch?
> 
> diff --git a/MoinMoin/Page.py b/MoinMoin/Page.py
> --- a/MoinMoin/Page.py
> +++ b/MoinMoin/Page.py
> @@ -217,6 +217,10 @@
>                      # never store empty pages, so this is detectable and also
>                      # safe when passed to a function expecting a string)
>                      return ""
> +                elif er.errno == errno.ENAMETOOLONG:
> +                    # If the name is too long, the page can't exist on this
> +                    # system either.
> +                    return ""
>                  else:
>                      raise
> 
> It fixed the issue for me, and applies cleanly against the 1.9 hg
> repository. I decided against an error message and instead opted to
> treat this like a file-not-found error (which, in some way it is).
> ./pytest also runs fine with the patched source.


OK, looks good. I fixed it in an equivalent way:

http://hg.moinmo.in/moin/1.9/rev/5e80523a1677

Thanks for the patch!

Cheers,

Thomas

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho