8000 Converting datetimes with non-trivial timezones to datetime64 is broken on python 2.6 · Issue #7336 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Converting datetimes with non-trivial timezones to datetime64 is broken on python 2.6 #7336
@njsmith

Description

@njsmith

As discussed in #7324, #6453 added a code path that references the timedelta.total_seconds() method, which is new in 2.7. We didn't notice this because the code path is only hit when converting Python datetime objects to datetime64, and only for datetime objects that have a .tzinfo attribute which is not None, and it turns out that we don't install pytz on Travis/Appveyor and so never actually ran this test on 2.6.

This is totally uninteresting for master, because master has already dropped 2.6 support (except that we should install pytz on Travis/Appveyor, which is #7335).

Options:

  • Replace this with some 2.6-compatible code. (it looks like we just need td.days * 86400 + td.seconds, though this is a bit annoying to do from C)
  • Declare that 2.6 is officially unsupported in 1.11
  • Mark this as a known 2.6-only bug in the release notes, move on with life

I guess I'm leaning towards the latter.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0