This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pandas.to_datetime crashes in 3.6b4
Type: Stage: resolved
Components: Extension Modules, Interpreter Core, macOS Versions: Python 3.6
process
Status: closed Resolution: duplicate
Dependencies: Superseder: strange issue with Pandas-0.19.1 on Python-3.6.0b3
View: 28636
Assigned To: Nosy List: Schouten, ned.deily, ronaldoussoren
Priority: normal Keywords:

Created on 2016-12-07 02:52 by Schouten, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg282588 - (view) Author: Dale (Schouten) Date: 2016-12-07 02:52
I'm trying 3.6b4 on my mac (OS X 10.10.5) and when I run the following code  (after doing pip install numpy and pandas) I see a 'SystemError':

>>> import pandas as pd
>>> pd.to_datetime('10/31/2016')
ValueError: Error parsing datetime string "10/31/2016" at position 2

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/schouten/virtualenvs/tmp/lib/python3.6/site-packages/pandas/util/decorators.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/Users/schouten/virtualenvs/tmp/lib/python3.6/site-packages/pandas/tseries/tools.py", line 430, in to_datetime
    return _convert_listlike(np.array([arg]), box, format)[0]
  File "/Users/schouten/virtualenvs/tmp/lib/python3.6/site-packages/pandas/tseries/tools.py", line 401, in _convert_listlike
    require_iso8601=require_iso8601
  File "pandas/tslib.pyx", line 2302, in pandas.tslib.array_to_datetime (pandas/tslib.c:43278)
  File "pandas/tslib.pyx", line 2458, in pandas.tslib.array_to_datetime (pandas/tslib.c:41773)
  File "pandas/tslib.pyx", line 2416, in pandas.tslib.array_to_datetime (pandas/tslib.c:41009)
  File "pandas/src/datetime.pxd", line 141, in datetime._string_to_dts (pandas/tslib.c:90460)
SystemError: <class 'str'> returned a result with an error set
>>>

sys.version says:

>>> import sys
>>> sys.version
'3.6.0b4 (v3.6.0b4:18496abdb3d5, Nov 21 2016, 20:44:47) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]'
>>> 



With 3.5 it works as expected:

>>> import sys
>>> sys.version
'3.5.1 (v3.5.1:37a07cee5969, Dec  5 2015, 21:12:44) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]'
>>> import pandas as pd
>>> pd.to_datetime('10/31/2016')
Timestamp('2016-10-31 00:00:00')
>>> 


I know it looks like pandas might be at fault, but given that the only thing I've changed is the Python version, I'm thinking it might be exposing a 3.6 bug (or vice versa, I suppose).


My apologies if I'm doing this all wrong, I'm new around here.
msg282591 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2016-12-07 03:57
Thanks for the report. This problem was reported previously in Issue28636 where it was determined that the problem is in Pandas (https://github.com/pandas-dev/pandas/issues/14561).  It looks like the Pandas project has pushed a fix for it.
msg282592 - (view) Author: Dale (Schouten) Date: 2016-12-07 04:04
Thanks for the quick response!
History
Date User Action Args
2022-04-11 14:58:40adminsetgithub: 73078
2016-12-07 04:04:58Schoutensetmessages: + msg282592
2016-12-07 03:57:40ned.deilysetstatus: open -> closed
superseder: strange issue with Pandas-0.19.1 on Python-3.6.0b3
messages: + msg282591

type: crash ->
resolution: duplicate
stage: resolved
2016-12-07 02:52:27Schoutencreate