[PATCH 1/2] A function for resolving date format and order

Anne Mulhern amulhern at redhat.com
Tue Oct 7 21:42:05 UTC 2014





----- Original Message -----
> From: "Brian C. Lane" <bcl at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Tuesday, October 7, 2014 4:40:18 PM
> Subject: Re: [PATCH 1/2] A function for resolving date format and order
> 
> On Tue, Oct 07, 2014 at 06:32:36PM +0200, Vratislav Podzimek wrote:
> > It's not that easy to get right order of date fields (year, month, day) and
> > their formats so we should better have it in a standalone function with
> > tests.
> > 
> > Related: rhbz#1044233
> > Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> > ---

<-- SNIP -->

> > +
> > +    order = []
> > +    formats = []
> > +    fmt_str = locale_mod.nl_langinfo(locale_mod.D_FMT)
> 
> Is it possible for this to return None or something without %? If so
> then we should catch that and default to something 'normal'.

>From the docs it seems more likely that nl_langinfo() or D_FMT might be undefined,
or that nl_langinfo() would fail to recognize its argument.

So, it might make sense to catch AttributeError and ValueError when getting fmt_str
and then set it to some default.

- mulhern

> 
> Other than that these look good to me.
> 
> --
> Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA
> (PST8PDT)
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 


More information about the anaconda-patches mailing list