(Ariadne Prod) feed error for datetime formatting

Bug #632541 reported by Jim B. Glenn
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KARL3
Fix Released
Low
Chris Rossi

Bug Description

several times reported in error monitor:

ENTRY
Tue Sep 7 08:26:01 2010
Exception when processing https://portal.ariadne-network.eu/communities/ariadne-central/atom.xml
Traceback (most recent call last):
  File "/opt/karl/ariadne/3.3.2-0/src/karl/karl/errorlog.py", line 15, in middleware
    return app(environ, start_response)
  File "/opt/karl/ariadne/3.3.2-0/eggs/repoze.retry-0.9.4-py2.5.egg/repoze/retry/__init__.py", line 88, in __call__
    app_iter = self.application(environ, replace_start_response)
  File "/opt/karl/ariadne/3.3.2-0/eggs/repoze.tm2-1.0a5-py2.5.egg/repoze/tm/__init__.py", line 23, in __call__
    result = self.application(environ, save_status_and_headers)
  File "/opt/karl/ariadne/3.3.2-0/eggs/Paste-1.7.2-py2.5.egg/paste/registry.py", line 350, in __call__
    app_iter = self.application(environ, start_response)
  File "/opt/karl/ariadne/3.3.2-0/eggs/repoze.who-1.0.15-py2.5.egg/repoze/who/middleware.py", line 107, in __call__
    app_iter = app(environ, wrapper.wrap_start_response)
  File "/opt/karl/ariadne/3.3.2-0/eggs/repoze.browserid-0.3-py2.5.egg/repoze/browserid/middleware.py", line 127, in __call__
    return self.app(environ, start_response)
  File "/opt/karl/ariadne/3.3.2-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/router.py", line 130, in __call__
    response = view_callable(context, request)
  File "/opt/karl/ariadne/3.3.2-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/configuration.py", line 1753, in _secured_view
    return view(context, request)
  File "/opt/karl/ariadne/3.3.2-0/src/karl/karl/views/atom.py", line 195, in community_atom_view
    return CommunityAtomFeed(context, request)()
  File "/opt/karl/ariadne/3.3.2-0/src/karl/karl/views/atom.py", line 73, in __call__
    xml = render_template(self._template, view=self)
  File "/opt/karl/ariadne/3.3.2-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/chameleon_zpt.py", line 73, in render_template
    return renderer(kw, {})
  File "/opt/karl/ariadne/3.3.2-0/eggs/repoze.bfg-1.2-py2.5.egg/repoze/bfg/chameleon_zpt.py", line 46, in __call__
    result = self.template(**system)
  File "/opt/karl/ariadne/3.3.2-0/eggs/Chameleon-1.1.1-py2.5.egg/chameleon/core/template.py", line 83, in __call__
    return self.render(**kwargs)
  File "/opt/karl/ariadne/3.3.2-0/eggs/Chameleon-1.1.1-py2.5.egg/chameleon/core/template.py", line 335, in render
    return super(TemplateFile, self).render(**kwargs)
  File "/opt/karl/ariadne/3.3.2-0/eggs/Chameleon-1.1.1-py2.5.egg/chameleon/zpt/template.py", line 18, in render
    return super(PageTemplate, self).render(**kwargs)
  File "/opt/karl/ariadne/3.3.2-0/eggs/Chameleon-1.1.1-py2.5.egg/chameleon/core/template.py", line 188, in render
    return self.cook_and_render(kwargs, utils.emptydict, None, True)
  File "/opt/karl/ariadne/3.3.2-0/eggs/Chameleon-1.1.1-py2.5.egg/chameleon/core/template.py", line 315, in cook_and_render
    args, slots, macro, global_scope)
  File "/opt/karl/ariadne/3.3.2-0/eggs/Chameleon-1.1.1-py2.5.egg/chameleon/core/template.py", line 180, in cook_and_render
    return func(econtext, rcontext)
  File "<string>", line 280, in render
  File "/opt/karl/ariadne/3.3.2-0/eggs/Chameleon-1.1.1-py2.5.egg/chameleon/core/codegen.py", line 29, in lookup_attr
    return getattr(obj, key)
  File "/opt/karl/ariadne/3.3.2-0/src/karl/karl/content/views/atom.py", line 43, in wrapper
    return convert_entities(f(*args, **kw))
  File "/opt/karl/ariadne/3.3.2-0/src/karl/karl/content/views/atom.py", line 84, in content
    'start_date': c.startDate.strftime(DATETIME_DISPLAY_FORMAT),
ValueError: year=10 is before 1900; the datetime strftime() methods require year >= 1900

Revision history for this message
Paul Everitt (paul-agendaless) wrote :

What an astonishing bug. Somebody has a feed that provides a date claiming to be year 10. Shocking. :)

Changed in karl3:
assignee: nobody → Chris Rossi (chris-archimedeanco)
importance: Undecided → Low
milestone: none → m47
Changed in karl3:
status: New → In Progress
Revision history for this message
Chris Rossi (chris-archimedeanco) wrote :

This is caused by a calendar event in one of the community calendars whose year was 10 instead of 2010. I have repaired the date in the Ariadne site, operating under the assumption that they meant 2010 instead of the year 10. I also spent some time trying to figure out how the year 10 got entered in the first place. I am not able to get the Calendar UI in Karl to let me enter a year less than 1900 for a date. Although it raises General Error rather than producing an error messagein the UI if I enter a sub 1900 year--something that should be fixed. I am not able, though, to create an event occurring in the year 10 using the calendar. I can't figure out how they managed to create an event with a year of 10.

I'm happy to fix the (lack of) validation problem with the add event view under the auspices of this bug if that is deemed appropriate, although I'd still like to figure out how that year of 10 got in there. It's possible that adding the validation would also close whatever loophole the event creator managed to get through to get a year of 10 in there.

Revision history for this message
Chris Rossi (chris-archimedeanco) wrote :

Extra validation is now checked in on trunk--users should not be able to enter years < 1900.

Changed in karl3:
status: In Progress → Fix Committed
Revision history for this message
JimPGlenn (jpglenn09) wrote :

fixed

Changed in karl3:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.