From 9521dd9d7df0df13a162cbceeadb36ef4cf91454 Mon Sep 17 00:00:00 2001 From: "Alan D. Snow" Date: Fri, 30 Aug 2019 20:42:02 -0500 Subject: [PATCH] FIX: address issue where PROJ core dumps on proj_create when global context does not have data directory set (#419) --- docs/history.rst | 1 + pyproj/_datadir.pyx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/history.rst b/docs/history.rst index b9e1ff089..142343fc0 100644 --- a/docs/history.rst +++ b/docs/history.rst @@ -5,6 +5,7 @@ Change Log ~~~~~ * Added cleanup for internal PROJ errors (issue #413) * Delay checking for pyproj data directory until importing pyproj (issue #415) +* Address issue where PROJ core dumps on proj_create with +init= when global context does not have data directory set (issue #415 & issue #368) 2.3.0 ~~~~~ diff --git a/pyproj/_datadir.pyx b/pyproj/_datadir.pyx index ee438dbcc..d77138125 100644 --- a/pyproj/_datadir.pyx +++ b/pyproj/_datadir.pyx @@ -13,7 +13,6 @@ cdef void pyproj_log_function(void *user_data, int level, const char *error_msg) if level == PJ_LOG_ERROR: ProjError.internal_proj_error = pystrdecode(error_msg) - cdef class ContextManager: def __cinit__(self): self.context = NULL @@ -42,6 +41,7 @@ cdef class ContextManager: for iii in range(len(data_dir_list)): b_data_dir = cstrencode(data_dir_list[iii]) c_data_dir[iii] = b_data_dir + proj_context_set_search_paths(NULL, len(data_dir_list), c_data_dir) proj_context_set_search_paths(self.context, len(data_dir_list), c_data_dir) finally: free(c_data_dir)