This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012年07月22日 14:25 by ced, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| calendar.patch | ced, 2012年07月22日 14:25 | calendar.patch | review | |
| calendar.patch | ced, 2012年09月20日 22:15 | calendar.patch | review | |
| Messages (7) | |||
|---|---|---|---|
| msg166137 - (view) | Author: Cédric Krier (ced) * | Date: 2012年07月22日 14:25 | |
itermonthdates fails when working on the last month of 9999 Here is a patch that catch the OverflowError. |
|||
| msg170820 - (view) | Author: Skip Montanaro (skip.montanaro) * (Python triager) | Date: 2012年09月20日 15:56 | |
LGTM |
|||
| msg170824 - (view) | Author: Terry J. Reedy (terry.reedy) * (Python committer) | Date: 2012年09月20日 17:16 | |
Context: http://issues.roundup-tracker.org/issue2550765 |
|||
| msg170854 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2012年09月20日 21:43 | |
Hi Cédric! while True: yield date - date += oneday + try: + date += oneday + except OverflowError: + break You might add a comment explaining why we may get an OverflowError here. I don't know the cost of adding a try/except in a loop. But the loop has 31 iterations or less, so it's maybe better to keep the explicit try/except around date += oneday. + def test_itermonthdates(self): + # ensure itermonthdates works for all months + list(calendar.Calendar().itermonthdates(9999, 12)) Please use datetime.MAXYEAR instead of this hardcoded constant. |
|||
| msg170859 - (view) | Author: Cédric Krier (ced) * | Date: 2012年09月20日 22:15 | |
Fix haypo comments |
|||
| msg170892 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2012年09月21日 14:29 | |
New changeset bfdf366a779a by Ezio Melotti in branch '2.7': #15421: fix an OverflowError in Calendar.itermonthdates() after datetime.MAXYEAR. Patch by Cédric Krier. http://hg.python.org/cpython/rev/bfdf366a779a New changeset aa73e60f65e9 by Ezio Melotti in branch '3.2': #15421: fix an OverflowError in Calendar.itermonthdates() after datetime.MAXYEAR. Patch by Cédric Krier. http://hg.python.org/cpython/rev/aa73e60f65e9 New changeset 59a2807872d5 by Ezio Melotti in branch 'default': #15421: merge with 3.2. http://hg.python.org/cpython/rev/59a2807872d5 |
|||
| msg170893 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2012年09月21日 14:30 | |
Fixed, thanks for the patch and the report! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:33 | admin | set | github: 59626 |
| 2012年09月21日 14:30:56 | ezio.melotti | set | status: open -> closed resolution: fixed messages: + msg170893 stage: patch review -> resolved |
| 2012年09月21日 14:29:40 | python-dev | set | nosy:
+ python-dev messages: + msg170892 |
| 2012年09月20日 22:15:44 | ced | set | files:
+ calendar.patch messages: + msg170859 |
| 2012年09月20日 21:43:10 | vstinner | set | messages: + msg170854 |
| 2012年09月20日 17:18:08 | ezio.melotti | set | assignee: ezio.melotti |
| 2012年09月20日 17:16:05 | terry.reedy | set | nosy:
+ terry.reedy messages: + msg170824 |
| 2012年09月20日 16:19:32 | vstinner | set | nosy:
+ vstinner |
| 2012年09月20日 15:56:01 | skip.montanaro | set | nosy:
+ skip.montanaro messages: + msg170820 |
| 2012年07月29日 21:59:38 | ezio.melotti | set | nosy:
+ rhettinger, belopolsky, ezio.melotti stage: patch review type: enhancement -> behavior versions: + Python 2.7, Python 3.2, Python 3.3 |
| 2012年07月22日 14:25:43 | ced | create | |