{"action":"created","issue":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/14631","repository_url":"https://api.github.com/repos/pandas-dev/pandas","labels_url":"https://api.github.com/repos/pandas-dev/pandas/issues/14631/labels{/name}","comments_url":"https://api.github.com/repos/pandas-dev/pandas/issues/14631/comments","events_url":"https://api.github.com/repos/pandas-dev/pandas/issues/14631/events","html_url":"https://github.com/pandas-dev/pandas/pull/14631","id":188506124,"number":14631,"title":"BUG/WIP: segfault manifesting with dateutil=2.6 w.r.t. replace when timezones are present","user":{"login":"jreback","id":953992,"avatar_url":"https://avatars.githubusercontent.com/u/953992?v=3","gravatar_id":"","url":"https://api.github.com/users/jreback","html_url":"https://github.com/jreback","followers_url":"https://api.github.com/users/jreback/followers","following_url":"https://api.github.com/users/jreback/following{/other_user}","gists_url":"https://api.github.com/users/jreback/gists{/gist_id}","starred_url":"https://api.github.com/users/jreback/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jreback/subscriptions","organizations_url":"https://api.github.com/users/jreback/orgs","repos_url":"https://api.github.com/users/jreback/repos","events_url":"https://api.github.com/users/jreback/events{/privacy}","received_events_url":"https://api.github.com/users/jreback/received_events","type":"User","site_admin":false},"labels":[{"id":76811,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Bug","name":"Bug","color":"e10c02","default":false},{"id":76865106,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Compat","name":"Compat","color":"0052cc","default":false},{"id":60458168,"url":"https://api.github.com/repos/pandas-dev/pandas/labels/Timezones","name":"Timezones","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-11-10T13:18:42Z","updated_at":"2016-11-10T14:43:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pandas-dev/pandas/pulls/14631","html_url":"https://github.com/pandas-dev/pandas/pull/14631","diff_url":"https://github.com/pandas-dev/pandas/pull/14631.diff","patch_url":"https://github.com/pandas-dev/pandas/pull/14631.patch"},"body":"closes #14621\r\n\r\nThis is very close, but a stubborn fall transition issue. any ideas? (note that this does not solve #7825 but should be a simple change after I think)\r\ncc @ischwabacher \r\ncc @rockg\r\ncc @sinhrks\r\ncc @adamgreenhall\r\ncc @pganssle  \r\n\r\n```\r\n(pandas) [Thu Nov 10 09:14:13 ~/pandas]$ nosetests  pandas/tseries/tests/test_offsets.py pandas/tseries/tests/test_timezones.py  -s \r\n...................S..S...........................................................................................................................................................................F...........................S..............................................................S...S.......................F................................................................................................................................................\r\n======================================================================\r\nFAIL: test_fallback_plural (pandas.tseries.tests.test_offsets.TestDST)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/Users/jreback/pandas/pandas/tseries/tests/test_offsets.py\", line 4900, in test_fallback_plural\r\n    expected_utc_offset=hrs_post)\r\n  File \"/Users/jreback/pandas/pandas/tseries/tests/test_offsets.py\", line 4850, in _test_all_offsets\r\n    self._test_offset(offset_name=name, offset_n=n, **kwds)\r\n  File \"/Users/jreback/pandas/pandas/tseries/tests/test_offsets.py\", line 4856, in _test_offset\r\n    self.assertTrue(get_utc_offset_hours(t) == expected_utc_offset)\r\nAssertionError: False is not true\r\n\r\n======================================================================\r\nFAIL: test_ambiguous_flags (pandas.tseries.tests.test_timezones.TestTimeZoneSupportDateutil)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/Users/jreback/pandas/pandas/tseries/tests/test_timezones.py\", line 524, in test_ambiguous_flags\r\n    freq=\"H\"))\r\nAssertionError: Times[28 chars]00', tz='dateutil//usr/share/zoneinfo/Europe/London', freq='H') != Times[28 chars]00', tz='dateutil//usr/share/zoneinfo/Europe/London', freq='H')\r\n\r\n----------------------------------------------------------------------\r\nRan 458 tests in 5.788s\r\n\r\nFAILED (SKIP=5, failures=2)\r\n```"},"comment":{"url":"https://api.github.com/repos/pandas-dev/pandas/issues/comments/259707415","html_url":"https://github.com/pandas-dev/pandas/pull/14631#issuecomment-259707415","issue_url":"https://api.github.com/repos/pandas-dev/pandas/issues/14631","id":259707415,"user":{"login":"pganssle","id":1377457,"avatar_url":"https://avatars.githubusercontent.com/u/1377457?v=3","gravatar_id":"","url":"https://api.github.com/users/pganssle","html_url":"https://github.com/pganssle","followers_url":"https://api.github.com/users/pganssle/followers","following_url":"https://api.github.com/users/pganssle/following{/other_user}","gists_url":"https://api.github.com/users/pganssle/gists{/gist_id}","starred_url":"https://api.github.com/users/pganssle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pganssle/subscriptions","organizations_url":"https://api.github.com/users/pganssle/orgs","repos_url":"https://api.github.com/users/pganssle/repos","events_url":"https://api.github.com/users/pganssle/events{/privacy}","received_events_url":"https://api.github.com/users/pganssle/received_events","type":"User","site_admin":false},"created_at":"2016-11-10T14:43:41Z","updated_at":"2016-11-10T14:43:41Z","body":"@jorisvandenbossche I can move it, yes, I'll make something a bit more formal later. I was just commenting on this because the use of undocumented features is likely a good place to look for possible changes. I think in this case, though, the issue is that PEP-495 actually changes the default fallback for unaware datetimes:\r\n\r\nSee:\r\n\r\n```python\r\nfrom dateutil import tz\r\nfrom datetime import datetime, timedelta\r\n\r\nLON = tz.gettz('Europe/London')\r\ndt1 = datetime(2013, 10, 26, 23, tzinfo=LON)\r\ndt2 = datetime(2013, 10, 27, 1, tzinfo=LON)\r\ndt3 = tz.enfold(dt2, fold=1)\r\n\r\nprint(dt1)   # 2013-10-26 23:00:00+01:00\r\nprint(dt2)   # 2013-10-27 01:00:00+01:00\r\nprint(dt3)   # 2013-10-27 01:00:00+00:00\r\n```\r\n\r\nI was expecting that no one was relying on this behavior because there was originally no actual way to construct `datetime` values with DST during ambiguous times, and I was adding this feature. Had I been involved in the PEP-495 discussions early enough, I would definitely have advocated using `fold=1` as \"DST\", not \"STD\", but it is what it is.\r\n\r\nIf you have the datetime as UTC already, it's very easy, just use `.astimezone()` and you will have a properly localized date (this is the case for pytz as well, actually). Otherwise, you can use `tz.datetime_ambiguous(dt, tz=None)` to check if a datetime is ambiguous and decide which side of the fold you want to be on using `tz.enfold()` (`fold` is ignored for non-ambiguous dates, so you can just enfold everything if you prefer). You can use `tz.datetime_exists(dt, tz=None)` to see if a date is in a \"gap\" in the given zone.\r\n\r\nEvidently, I forgot to add these functions to `__all__`, on `tz`, so they haven't shown up in the documentation. A list of releases with changes is [here](https://github.com/dateutil/dateutil/releases)."}}
{"actor":{"display_login":"pganssle"}}