Opened 5 years ago

Closed 5 years ago

#3159 closed defect (fixed)

Registration traceback

Reported by: Greg Couch Owned by: Conrad Huang
Priority: blocker Milestone: 1.0
Component: Infrastructure Version:
Keywords: Cc: pett, Greg Couch
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description

At the beginning of #3123 is a traceback in the Registration bundle. strptime fails to parse the date string. This might be caused by the %a and %b specifiers, since they are locale dependent. Recommendation would be to put a context manager around uses of strftime and strptime that would set the locale to an English variation writing and parsing dates, as appropriate.

error | Bundle 'ChimeraX-Registration' custom initialization failed  
warning | Traceback (most recent call last):  
File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-
packages/chimerax/core/toolshed/info.py", line 432, in initialize  
api._api_caller.initialize(api, session, self)  
File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-
packages/chimerax/core/toolshed/__init__.py", line 1652, in initialize  
return cls._get_func(api, "initialize")(session, bi)  
File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-
packages/chimerax/registration/__init__.py", line 41, in initialize  
nag(session)  
File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-
packages/chimerax/registration/nag.py", line 28, in nag  
if not check_registration(logger=session.logger):  
File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-
packages/chimerax/registration/nag.py", line 49, in check_registration  
return _check_expiration(param, logger)  
File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/site-
packages/chimerax/registration/nag.py", line 131, in _check_expiration  
expires = datetime.strptime(param["Expires"], TimeFormat)  
File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/_strptime.py", line 577, in
_strptime_datetime  
tt, fraction, gmtoff_fraction = _strptime(data_string, format)  
File "/usr/lib/ucsf-chimerax-daily/lib/python3.7/_strptime.py", line 359, in
_strptime  
(data_string, format))  
ValueError: time data 'Tue Apr 13 07:53:02 2021' does not match format '%a %b
%d %H:%M:%S %Y'  

Change History (1)

comment:1 by Conrad Huang, 5 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [changset:1a20a02de].

Temporarily set locale to en_us when parsing registration timestamps.

Note: See TracTickets for help on using tickets.