Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

FixedOffsetTimezone repr is wrong for negative offsets

#94

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)'

Reported by Menno · January 25th, 2012 @ 04:39 PM

State: resolved
Milestone: none
Assigned to: nobody

Activity

  1. Daniele Varrazzo
    Daniele Varrazzo
    • State changed from new to open

    Thanks Menno, but you forgot to apply the patch! :)

    January 29th, 2012 @ 07:38 PM

  2. Menno
  3. Menno
    Menno

    Oops, patched attached now.

    January 30th, 2012 @ 12:31 PM

  4. Daniele Varrazzo
    Daniele Varrazzo
    • 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!

    January 30th, 2012 @ 01:22 PM

  5. Menno
    Menno

    Sorry, I haven't used git much outside of "git svn".

    Thanks for taking the changes.

    January 30th, 2012 @ 01:53 PM