Skip to content

ARROW-6597: [Python] Sanitize Python datetime handling#5416

Closed
pitrou wants to merge 1 commit intoapache:masterfrom
pitrou:ARROW-6597-py-datetime-handling
Closed

ARROW-6597: [Python] Sanitize Python datetime handling#5416
pitrou wants to merge 1 commit intoapache:masterfrom
pitrou:ARROW-6597-py-datetime-handling

Conversation

@pitrou
Copy link
Member

@pitrou pitrou commented Sep 18, 2019

The official datetime C macros (PyDate*) operate on a static variable
named PyDateTimeAPI. This forces us to initialize that static variable
using PyDateTime_IMPORT in every datetime-using C++ module. Fix the
issue by redefining PyDateTimeAPI to a global variable.

Fixes a crash I got locally in test_pandas.py.

The official datetime C macros (PyDate*) operate on a static variable
named PyDateTimeAPI.  This forces us to initialize that static variable
using PyDateTime_IMPORT in every datetime-using C++ module.  Fix the
issue by redefining PyDateTimeAPI to a global variable.

Fixes a crash I got locally in test_pandas.py.
@kszucs
Copy link
Member

kszucs commented Sep 18, 2019

This was bothering me, but wasn't sure how to fix it, looks much better now.

@pitrou
Copy link
Member Author

pitrou commented Sep 18, 2019

Travis-CI passed: https://travis-ci.org/pitrou/arrow/builds/586472251

@pitrou pitrou closed this in 329c994 Sep 18, 2019
@pitrou pitrou deleted the ARROW-6597-py-datetime-handling branch September 18, 2019 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants