This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: time.strptime() access non existant attribute in calendar.py
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: brett.cannon, thead
Priority: normal Keywords:

Created on 2006-09-15 18:08 by thead, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg29839 - (view) Author: betatim (thead) Date: 2006-09-15 18:08
>>> import time
>>> time.strptime(time.ctime())
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.4/_strptime.py", line 269, in ?
    _TimeRE_cache = TimeRE()
  File "/usr/lib/python2.4/_strptime.py", line 188, in
__init__
    self.locale_time = LocaleTime()
  File "/usr/lib/python2.4/_strptime.py", line 74, in
__init__
    self.__calc_weekday()
  File "/usr/lib/python2.4/_strptime.py", line 94, in
__calc_weekday
    a_weekday = [calendar.day_abbr[i].lower() for i in
range(7)]
AttributeError: 'module' object has no attribute 'day_abbr'
>>> time.ctime() 
'Fri Sep 15 19:06:18 2006'

The default format used by strptime() should match the
output of ctime(). Even when specifying the format I
get exactly the same error.

I have recently upgraded to gcc 4.1.1 and glibc-2.4-r3.
Using python-2.4.3.

I am not quite sure what causes this.


cheers tim
msg29840 - (view) Author: betatim (thead) Date: 2006-09-15 19:04
Logged In: YES 
user_id=1231298

to make sure there wasn't anything boviously wrong with my
time and strptime i run test_time.py and test_strptime.py
both of which have passed all tests
msg29841 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2006-09-15 19:41
Logged In: YES 
user_id=357491

Tested on Python 2.4, 2.5, and trunk and all work for me. 
Closing as invalid.

If you look at the traceback there is an issue with the
calendar module in your installation, not with
time.strptime() (looks like calendar.day_abbr is missing). 
I would run test_calendar and see what happens with that. 
If that test fails then file a bug report on that (and maybe
also test_datetime since that is where the calendar module
gets its information for the day-abbr).
History
Date User Action Args
2022-04-11 14:56:20adminsetgithub: 43979
2006-09-15 18:08:54theadcreate