Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'importing': 0.04; 'attribute': 0.05; 'error:': 0.05; 'startup': 0.05; 'subject:skip:t 10': 0.07; 'subject:How': 0.09; 'python': 0.09; 'broke': 0.09; 'expected.': 0.09; 'imported': 0.09; '3.1.3': 0.16; 'also:': 0.16; 'normally.': 0.16; 'threads': 0.16; 'url:detail': 0.16; 'url:issues': 0.16; 'webapp': 0.16; '(or': 0.18; 'module': 0.19; 'to:name:python-list@python.org': 0.20; 'trying': 0.21; 'import': 0.21; 'occurs': 0.22; 'errors': 0.23; 'to:2**1': 0.23; "i've": 0.23; 'received:169.254': 0.24; 'header:In-Reply-To:1': 0.25; '2.6': 0.27; 'received:216.32': 0.27; 'run': 0.28; 'normal.': 0.29; 'received:169': 0.29; 'url:code': 0.29; 'maybe': 0.29; 'error': 0.30; 'header:Received:8': 0.30; 'url:python': 0.32; 'running': 0.32; 'received:10.43': 0.33; 'problem': 0.33; 'to:addr:python-list': 0.33; 'server': 0.35; 'received:bigfish.com': 0.35; 'url:org': 0.36; 'charset:us-ascii': 0.36; 'subject:: ': 0.38; 'object': 0.38; 'received:10': 0.38; 'to:addr:python.org': 0.39; 'you.': 0.61; 'received:216': 0.62; 'url:p': 0.63; 'subject:get': 0.81; 'url:177': 0.84 X-Forefront-Antispam-Report: CIP:157.56.240.117; KIP:(null); UIP:(null); IPV:NLI; H:BL2PRD0610HT004.namprd06.prod.outlook.com; RD:none; EFVD:NLI X-SpamScore: -1 X-BigFish: PS-1(zz1432Izz1de0h1202h1e76h1d1ah1d2ahzz8275bh8275dh17326ahz2fh2a8h668h839h944hd25hf0ah1220h1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh15d0h162dh1631h1758h1155h) Received-SPF: pass (mail213-ch1: domain of npcinternational.com designates 157.56.240.117 as permitted sender) client-ip=157.56.240.117; envelope-from=nick.cash@npcinternational.com; helo=BL2PRD0610HT004.namprd06.prod.outlook.com ; .outlook.com ; From: Nick Cash To: Gnarlodious , "python-list@python.org" Subject: RE: How to get time.strptime()? Thread-Topic: How to get time.strptime()? Thread-Index: AQHN44cIbpW82gzvKUSBaeL4xecgoZgrj/og Date: Wed, 26 Dec 2012 21:06:12 +0000 References: <5692cd23-84e0-46d4-b48c-5c11a5377c0a@googlegroups.com> In-Reply-To: <5692cd23-84e0-46d4-b48c-5c11a5377c0a@googlegroups.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [70.166.238.194] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: npcinternational.com 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: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356555987 news.xs4all.nl 6849 [2001:888:2000:d::a6]:43683 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35542 > Error: AttributeError: 'module' object has no attribute '_strptime' >=20 > This problem is driving me crazy. It only happens in Python 3.3.0, > while on my server running 3.1.3 it behaves as expected. When I try to > access time.strptime() it errors with >=20 > AttributeError: 'module' object has no attribute '_strptime'. >=20 > This error only occurs under mod_wsgi, when running as a one-shot > webapp it behaves normally. All other functionalities of the time > module are normal. I've run into this issue in the past with Python 2.6 (or maybe 2.7) and mod= _python. My problem was that datetime.strptime imported _strptime at runtim= e, and multiple threads trying to import it at the same time broke an inter= nal import lock. I was able to work around this by simply importing _strptime myself at serv= er startup time. This may or may not work for you. See also: http://code.google.com/p/modwsgi/issues/detail?id=3D177 and http:= //www.mail-archive.com/python-list@python.org/msg248664.html=20