[issue13556] When tzinfo.utcoffset is out-of-bounds, the exception message is misleading

2012-06-22 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Fixed in changeset a7237f157625.

--
resolution:  -> fixed
status: open -> closed
versions:  -Python 2.7

___
Python tracker 

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



[issue13556] When tzinfo.utcoffset is out-of-bounds, the exception message is misleading

2012-06-13 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Does anyone still care about this issue? I think the error message in 3.2 is 
good enough and fixing this in 2.x is not worth the trouble.  I am inclined to 
close this as "won't fix".

--
versions: +Python 3.3 -Python 3.4

___
Python tracker 

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



[issue13556] When tzinfo.utcoffset is out-of-bounds, the exception message is misleading

2012-01-03 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Is 3.3 message better?

>>> datetime.now(tz=X())
Traceback (most recent call last):
  File "", line 1, in 
ValueError: offset must be a timedelta strictly between -timedelta(hours=24) 
and timedelta(hours=24).

In 2.7, the message is indeed misleading:

>>> datetime.now(tz=X())
Traceback (most recent call last):
  File "", line 1, in 
ValueError: tzinfo.utcoffset() returned 1440; must be in -1439 .. 1439

I am not sure fixing this in 2.x is worth the trouble, but I would consider 
improving the message in 3.x by adding information about the actual offset.  I 
vaguely remember that there was a reason for leaving that info out in 3.x.

--
assignee:  -> belopolsky
stage:  -> needs patch
versions: +Python 3.4

___
Python tracker 

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



[issue13556] When tzinfo.utcoffset is out-of-bounds, the exception message is misleading

2012-01-03 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +belopolsky, lemburg

___
Python tracker 

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



[issue13556] When tzinfo.utcoffset is out-of-bounds, the exception message is misleading

2011-12-08 Thread Jean-Paul Calderone

New submission from Jean-Paul Calderone :

When a timezone produces an out-of-bounds utc offset, the resulting exception 
always claims that the offset was 1440, rather than whatever it was.  Example:

from datetime import timedelta, datetime, tzinfo

class X(tzinfo):
def utcoffset(self, time):
return timedelta(days=2)

datetime.now(tz=X())

--
components: Library (Lib)
messages: 149046
nosy: exarkun
priority: normal
severity: normal
status: open
title: When tzinfo.utcoffset is out-of-bounds, the exception message is 
misleading
type: behavior
versions: Python 2.7

___
Python tracker 

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