This project is archived and is in readonly mode.
FixedOffsetTimezone repr is wrong for negative offsets
Reported by Menno | January 25th, 2012 @ 04:39 PM
For offsets west of UTC the repr of FixedOffsetTimezone shows a
positive and confusing offset value. The offset used during passed
to init is not the offset shown in the
repr.
>>> from psycopg2.tz import FixedOffsetTimezone
>>> repr(FixedOffsetTimezone(-300))
'psycopg2.tz.FixedOffsetTimezone(offset=1140, name=None)'
The attached patch fixes this (and adds tests for this class).
The repr then looks like this:
>>> from psycopg2.tz import FixedOffsetTimezone
>>> repr(FixedOffsetTimezone(-300))
'psycopg2.tz.FixedOffsetTimezone(offset=-300, name=None)'
Comments and changes to this ticket
-
Daniele Varrazzo January 29th, 2012 @ 07:38 PM
- State changed from new to open
Thanks Menno, but you forgot to apply the patch! :)
-
Menno January 30th, 2012 @ 12:27 PM
- no changes were found...
-
Daniele Varrazzo January 30th, 2012 @ 01:22 PM
- State changed from open to resolved
Committed. Note that your patches fails to apply with "git am", so I have to do some copypaste to keep the attribution: it would be great if you could use git format-patch when attaching a patch.
Thank you!
-
Menno January 30th, 2012 @ 01:53 PM
Sorry, I haven't used git much outside of "git svn".
Thanks for taking the changes.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.
People watching this ticket
Attachments
Referenced by
- 95 Cache FixedOffsetTimezone instances Note that this patch relies on the patch attached to #94 ...