Roundup Tracker - Issues

Issue 2550765

classification
Some links shown by html_calendar are going to fail
Type: behavior Severity: normal
Components: Web interface Versions:
process
Status: closed fixed
:
: : ber, ced, ezio.melotti
Priority: normal : patch

Created on 2012-07-22 13:49 by ced, last changed 2012-09-24 07:47 by ber.

Files
File name Uploaded Description Edit Remove
html_calendar.patch ced, 2012-07-31 22:24
Messages
msg4591 Author: [hidden] (ced) Date: 2012-07-22 13:49
On one of my roundup instance, I have a crawler that follow the calendar
and it reach the year 9999.
But the calendar display a link for next year but this link fails
because Python has a limit on datetime.year.
Here is a patch that prevents to show links that will fail.
msg4592 Author: [hidden] (ber) Date: 2012-07-23 06:46
Cédric,
thanks for the patch.

What is a good way to reach all the code paths that you have added?
(Best probably is an automatic test case? >:) )
msg4595 Author: [hidden] (ber) Date: 2012-07-29 20:04
Hi Cédric,

tested your patch now:
It solved 3 our of 4 cases for me.
When being on Nov 999, the next link for the month is shown
and leads to exceptions.OverflowError'>: date value out of range
in line 
        for week in calendar.monthcalendar(display.year, display.month):

If you happen to do a new patch, could you add a CHANGES.txt
entry as well? :)

Thanks,
Bernhard
msg4596 Author: [hidden] (ced) Date: 2012-07-29 21:01
On 29/07/12 20:04 +0000, Bernhard Reiter wrote:
> tested your patch now:
> It solved 3 our of 4 cases for me.
> When being on Nov 999, the next link for the month is shown
> and leads to exceptions.OverflowError'>: date value out of range
> in line 
>         for week in calendar.monthcalendar(display.year, display.month):

I know but it is a Python bug:

    http://bugs.python.org/issue15421

> If you happen to do a new patch, could you add a CHANGES.txt
> entry as well? :)

Ok, but I was looking how to add testcase for this.

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric.krier@b2ck.com
Website: http://www.b2ck.com/
msg4597 Author: [hidden] (ber) Date: 2012-07-29 21:34
Ah, nice to know this is a python defect, would have been cool to know before 
testing. 

If creating an automated testcase is too cumbersome, we can do without.
The code for the test should not exceed the tested code too much in this case I 
believe.
msg4598 Author: [hidden] (ced) Date: 2012-07-31 22:24
Adding testcase is too cumbersome.
So here is the patch with the CHANGES entry.
msg4599 Author: [hidden] (ber) Date: 2012-08-01 06:51
Thanks!
hg4651:beb8d43f4d9d
msg4603 Author: [hidden] (ezio.melotti) Date: 2012-08-02 07:42
While fixing the error when the year 9999 is reached is a good thing,
have you considered adding a <meta name="robots" content="noindex,
nofollow"> so that the search engines* will avoid wasting time and
resources to go through ~8000 years of links needlessly?

If you think this is reasonable I can add the meta tag to the
_generic.calendar.html page.

* Note that this won't prevent all the robots to follow the links, but
it's still better than nothing.
msg4604 Author: [hidden] (ber) Date: 2012-08-02 08:11
Ezio,
sounds like a good idea to me. Feel free to go head.
msg4652 Author: [hidden] (ezio.melotti) Date: 2012-09-21 14:57
I added <meta name="robots" content="noindex, nofollow"> to the calendar
pages in a099ff2ceff3, and fixed the upstream Python issue too.
msg4653 Author: [hidden] (ber) Date: 2012-09-24 07:47
Ezio: Cool, thanks!
History
Date User Action Args
2012-09-24 07:47:41bersetmessages: + msg4653
2012-09-21 14:57:52ezio.melottisetmessages: + msg4652
2012-08-02 08:11:59bersetmessages: + msg4604
2012-08-02 07:43:01ezio.melottisetmessages: + msg4603
2012-08-01 06:51:46bersetstatus: new -> closed
resolution: fixed
messages: + msg4599
2012-07-31 22:24:20cedsetfiles: - html_calendar.patch
2012-07-31 22:24:09cedsetfiles: + html_calendar.patch
messages: + msg4598
2012-07-29 21:34:39bersetmessages: + msg4597
2012-07-29 21:01:11cedsetmessages: + msg4596
2012-07-29 20:04:04bersetmessages: + msg4595
2012-07-29 03:45:12ezio.melottisetpriority: normal
nosy: + ezio.melotti
2012-07-23 06:46:39bersetnosy: + ber
messages: + msg4592
title: Enforce html_calendar for crawlers -> Some links shown by html_calendar are going to fail
2012-07-22 13:49:28cedcreate