[issue26650] calendar: OverflowErrors for year == 1 and firstweekday > 0

2016-09-27 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Make Calendar.itermonthdates() behave consistently in edge cases

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26650] calendar: OverflowErrors for year == 1 and firstweekday > 0

2016-09-26 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

My patch for issue 28253 fixes this problem for itermonthdays2() and 
itermonthdays() methods.  As discussed there, fixing itermonthdates() would 
require changing a documented public interface.

--
assignee:  -> belopolsky
nosy: +belopolsky

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26650] calendar: OverflowErrors for year == 1 and firstweekday > 0

2016-03-27 Thread SilentGhost

SilentGhost added the comment:

Here is the patch. Both this patch and the fix for #15421 might violate the 
documented behaviour of getting the full week's worth of dates. I wonder if 
that should also be documented.

--
keywords: +patch
nosy: +SilentGhost, rhettinger
stage:  -> patch review
type: crash -> behavior
versions: +Python 3.6
Added file: http://bugs.python.org/file42305/issue26650.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26650] calendar: OverflowErrors for year == 1 and firstweekday > 0

2016-03-27 Thread Martijn Pieters

New submission from Martijn Pieters:

For anything other than calendar.Calendar(0), many methods lead to 
OverflowError exceptions:

>>> import calendar
>>> c = calendar.Calendar(0)
>>> list(c.itermonthdays(1, 1))
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 
23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 0, 0, 0]
>>> c = calendar.Calendar(1)
>>> list(c.itermonthdays(1, 1))
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python2.7/calendar.py",
 line 188, in itermonthdays
for date in self.itermonthdates(year, month):
  File 
"/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python2.7/calendar.py",
 line 160, in itermonthdates
date -= datetime.timedelta(days=days)
OverflowError: date value out of range

This echoes a similar problem with year = , see issue #15421

--
components: Library (Lib)
messages: 262514
nosy: mjpieters
priority: normal
severity: normal
status: open
title: calendar: OverflowErrors for year == 1 and firstweekday > 0
type: crash
versions: Python 2.7, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com