Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!fdn.fr!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(python': 0.07; 'attribute': 0.07; 'elements.': 0.07; 'skip:" 60': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; '1.5,': 0.16; 'attribute,': 0.16; 'modules,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'wrote:': 0.18; 'import': 0.22; 'header:User- Agent:1': 0.23; 'skip': 0.24; 'versions': 0.24; 'skip:" 30': 0.26; 'updating': 0.26; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'skip:p 30': 0.29; 'newer': 0.30; "i'm": 0.30; 'file': 0.32; 'this.': 0.32; 'run': 0.32; '(most': 0.33; 'mac': 0.33; 'older': 0.33; 'trouble': 0.34; 'skip:d 20': 0.34; 'problem': 0.35; 'but': 0.35; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'little': 0.38; 'recent': 0.39; 'realize': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'most': 0.60; 'received:173': 0.61; 'subject:. ': 0.67; 'home': 0.69; 'latest,': 0.84; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: utcoffset v. _utcoffset Date: Wed, 21 Aug 2013 16:25:10 -0400 References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1377116724 news.xs4all.nl 15872 [2001:888:2000:d::a6]:37564 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52792 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 > 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