[Django] #21112: Sitemaps without lastmod dates are broken (Django 1.7 / master only)

13 views
Skip to first unread message

Django

unread,
Sep 17, 2013, 9:51:06 AM9/17/13
to django-...@googlegroups.com
#21112: Sitemaps without lastmod dates are broken (Django 1.7 / master only)
----------------------------------+--------------------
Reporter: mk | Owner: nobody
Type: Bug | Status: new
Component: contrib.sitemaps | Version: master
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
----------------------------------+--------------------
While running the FeinCMS testsuite with Django 1.7 / master, I found a
new problem introduced by 8f5533ab250df07ea84f98d39808806e282468a5 (the
fix for #20793).


{{{
Traceback (most recent call last):
File "/home/mk/Projects/feincms/tests/testapp/tests/test_page.py", line
1428, in test_36_sitemaps
response = self.client.get('/sitemap.xml')
File
"/home/mk/Projects/feincms/tests/.tox/py27-1.7.X/src/django/django/test/client.py",
line 452, in get
response = super(Client, self).get(path, data=data, **extra)
File
"/home/mk/Projects/feincms/tests/.tox/py27-1.7.X/src/django/django/test/client.py",
line 279, in get
return self.generic('GET', path, **r)
File
"/home/mk/Projects/feincms/tests/.tox/py27-1.7.X/src/django/django/test/client.py",
line 341, in generic
return self.request(**r)
File
"/home/mk/Projects/feincms/tests/.tox/py27-1.7.X/src/django/django/test/client.py",
line 423, in request
six.reraise(*exc_info)
File
"/home/mk/Projects/feincms/tests/.tox/py27-1.7.X/src/django/django/core/handlers/base.py",
line 114, in get_response
response = wrapped_callback(request, *callback_args,
**callback_kwargs)
File
"/home/mk/Projects/feincms/tests/.tox/py27-1.7.X/src/django/django/contrib/sitemaps/views.py",
line 15, in inner
response = func(request, *args, **kwargs)
File
"/home/mk/Projects/feincms/tests/.tox/py27-1.7.X/src/django/django/contrib/sitemaps/views.py",
line 75, in sitemap
timegm(site.latest_lastmod.utctimetuple()))
AttributeError: 'NoneType' object has no attribute 'utctimetuple'
}}}

The attached patch ensures that site.latest_lastmod is only set if it
actually is a datetime value. Test is included.

(PS: This is my 21. issue submitted to the Django bugtracker; I did not
count patches but I would be a honor if someone could add me to the
AUTHORS file. https://code.djangoproject.com/query?owner=mk /
https://code.djangoproject.com/query?reporter=mk TIA :-)

--
Ticket URL: <https://code.djangoproject.com/ticket/21112>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 17, 2013, 10:01:52 AM9/17/13
to django-...@googlegroups.com
#21112: Sitemaps without lastmod dates are broken (Django 1.7 / master only)
----------------------------------+------------------------------------

Reporter: mk | Owner: nobody
Type: Bug | Status: new
Component: contrib.sitemaps | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by charettes):

* needs_better_patch: => 1
* stage: Unreviewed => Accepted
* severity: Release blocker => Normal
* needs_tests: => 0
* needs_docs: => 0


Comment:

Patch looks good!

Please provide a new one with yourself added to the
[https://github.com/django/django/blob/master/AUTHORS AUTHORS] and I'll
make sure to honor your request :)

--
Ticket URL: <https://code.djangoproject.com/ticket/21112#comment:1>

Django

unread,
Sep 17, 2013, 10:07:02 AM9/17/13
to django-...@googlegroups.com
#21112: Sitemaps without lastmod dates are broken (Django 1.7 / master only)
----------------------------------+------------------------------------

Reporter: mk | Owner: nobody
Type: Bug | Status: new
Component: contrib.sitemaps | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------

Comment (by mk):

Simon, thanks for the review. I added the AUTHORS change to 21112.patch.

--
Ticket URL: <https://code.djangoproject.com/ticket/21112#comment:2>

Django

unread,
Sep 17, 2013, 10:23:52 AM9/17/13
to django-...@googlegroups.com
#21112: Sitemaps without lastmod dates are broken (Django 1.7 / master only)
----------------------------------+------------------------------------
Reporter: mk | Owner: nobody
Type: Bug | Status: closed
Component: contrib.sitemaps | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
----------------------------------+------------------------------------
Changes (by Simon Charette <charette.s@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"f5f662fa5f4efd1f0fdd7901ed58c34f384af532"]:
{{{
#!CommitTicketReference repository=""
revision="f5f662fa5f4efd1f0fdd7901ed58c34f384af532"
Fixed #21112 -- Make sure sitemaps with no lastmod date work correctly.

Thanks to Matthias Kestenholz for the report and patch.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21112#comment:3>

Reply all
Reply to author
Forward
0 new messages