Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52792 > unrolled thread

Re: utcoffset v. _utcoffset

Started byTerry Reedy <tjreedy@udel.edu>
First post2013-08-21 16:25 -0400
Last post2013-08-21 16:25 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: utcoffset v. _utcoffset Terry Reedy <tjreedy@udel.edu> - 2013-08-21 16:25 -0400

#52792 — Re: utcoffset v. _utcoffset

FromTerry Reedy <tjreedy@udel.edu>
Date2013-08-21 16:25 -0400
SubjectRe: utcoffset v. _utcoffset
Message-ID<mailman.102.1377116724.19984.python-list@python.org>
On 8/21/2013 2:05 PM, Skip Montanaro wrote:
> Consider this little Python script:
>
> import dateutil.parser
> import pytz

Neither of these are stdlib modules, so I cannot run this.

> x = dateutil.parser.parse("2013-08-16 23:00:00+01:00")
> localtz = pytz.timezone("America/Chicago")
> y = localtz.normalize(x)
>
> When I execute it (Python 2.7.2, dateutil 1.5, pytz 2011h), I get this
> traceback:
>
> Traceback (most recent call last):
>    File "/home/skipm/tmp/localtzex.py", line 8, in <module>
>      y = localtz.normalize(x)
>    File "/opt/TWWfsw/python27p/lib/python2.7/site-packages/pytz/tzinfo.py",
> line 233, in normalize
>      offset = dt.tzinfo._utcoffset
> AttributeError: 'tzoffset' object has no attribute '_utcoffset'
>
> Looking at the tzinfo attribute, I see that it has "utcoffset", but
> not "_utcoffset".  I realize those are the latest, most up-to-datest
> versions of all three elements.  I'm having trouble updating dateutil
> and pytz on my Mac at home (stuck on even older versions).  Can
> someone with newer versions of dateutil and pytz see if this problem
> is still present?

-- 
Terry Jan Reedy

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web