pyogrio 0.7.2__cp311-cp311-win_amd64.whl → 0.9.0__cp311-cp311-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyogrio might be problematic. Click here for more details.

Files changed (83) hide show
  1. pyogrio/__init__.py +7 -3
  2. pyogrio/_compat.py +6 -1
  3. pyogrio/_err.c +855 -321
  4. pyogrio/_err.cp311-win_amd64.pyd +0 -0
  5. pyogrio/_err.pyx +7 -3
  6. pyogrio/_geometry.c +134 -75
  7. pyogrio/_geometry.cp311-win_amd64.pyd +0 -0
  8. pyogrio/_io.c +28462 -22659
  9. pyogrio/_io.cp311-win_amd64.pyd +0 -0
  10. pyogrio/_io.pyx +904 -242
  11. pyogrio/_ogr.c +1317 -1640
  12. pyogrio/_ogr.cp311-win_amd64.pyd +0 -0
  13. pyogrio/_ogr.pxd +69 -13
  14. pyogrio/_ogr.pyx +8 -24
  15. pyogrio/_version.py +3 -3
  16. pyogrio/_vsi.c +6815 -0
  17. pyogrio/_vsi.cp311-win_amd64.pyd +0 -0
  18. pyogrio/_vsi.pxd +4 -0
  19. pyogrio/_vsi.pyx +140 -0
  20. pyogrio/core.py +43 -44
  21. pyogrio/gdal_data/GDAL-targets-release.cmake +1 -1
  22. pyogrio/gdal_data/GDAL-targets.cmake +10 -6
  23. pyogrio/gdal_data/GDALConfigVersion.cmake +3 -3
  24. pyogrio/gdal_data/gdalinfo_output.schema.json +2 -0
  25. pyogrio/gdal_data/gdalvrt.xsd +163 -0
  26. pyogrio/gdal_data/ogrinfo_output.schema.json +12 -1
  27. pyogrio/gdal_data/vcpkg.spdx.json +23 -23
  28. pyogrio/gdal_data/vcpkg_abi_info.txt +29 -28
  29. pyogrio/geopandas.py +140 -34
  30. pyogrio/proj_data/ITRF2008 +2 -2
  31. pyogrio/proj_data/proj-config-version.cmake +2 -2
  32. pyogrio/proj_data/proj-config.cmake +2 -1
  33. pyogrio/proj_data/proj-targets-release.cmake +0 -1
  34. pyogrio/proj_data/proj-targets.cmake +10 -6
  35. pyogrio/proj_data/proj.db +0 -0
  36. pyogrio/proj_data/proj4-targets-release.cmake +0 -1
  37. pyogrio/proj_data/proj4-targets.cmake +10 -6
  38. pyogrio/proj_data/vcpkg.spdx.json +21 -43
  39. pyogrio/proj_data/vcpkg_abi_info.txt +16 -17
  40. pyogrio/raw.py +438 -116
  41. pyogrio/tests/conftest.py +75 -6
  42. pyogrio/tests/fixtures/poly_not_enough_points.shp.zip +0 -0
  43. pyogrio/tests/test_arrow.py +841 -7
  44. pyogrio/tests/test_core.py +99 -7
  45. pyogrio/tests/test_geopandas_io.py +827 -121
  46. pyogrio/tests/test_path.py +23 -3
  47. pyogrio/tests/test_raw_io.py +276 -50
  48. pyogrio/util.py +39 -19
  49. pyogrio-0.9.0.dist-info/DELVEWHEEL +2 -0
  50. {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/METADATA +2 -2
  51. {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/RECORD +72 -67
  52. {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/WHEEL +1 -1
  53. pyogrio.libs/Lerc-5e4d8cbeeabca06f95e2270792304dc3.dll +0 -0
  54. pyogrio.libs/{gdal-c3b1d8f66682071d0cd26d86e4182013.dll → gdal-b434963605a006e01c486c0df6dea4e0.dll} +0 -0
  55. pyogrio.libs/geos-f0622d0794b81c937a851b2e6fa9b712.dll +0 -0
  56. pyogrio.libs/geos_c-0e16bf70612fc3301d077b9d863a3fdb.dll +0 -0
  57. pyogrio.libs/{geotiff-e43cdab688866b59f8800cfcde836d16.dll → geotiff-772e7c705fb15ddf91b432adb4eb1f6c.dll} +0 -0
  58. pyogrio.libs/iconv-2-8fcc23ddc6f096c45871011b6e008b44.dll +0 -0
  59. pyogrio.libs/{jpeg62-567ab743ac805dfb57fe3867ba5788a4.dll → jpeg62-2f9b7af22d78338e8f0be0058503dc35.dll} +0 -0
  60. pyogrio.libs/json-c-e52a077545e4057de42beb4948289b41.dll +0 -0
  61. pyogrio.libs/libcurl-bc81cd8afe15b10c0821b181b6af8bd0.dll +0 -0
  62. pyogrio.libs/libexpat-fbe03ca8917dfda776562d4338b289b8.dll +0 -0
  63. pyogrio.libs/{liblzma-de7f4770d4e3715acd031ca93883f10c.dll → liblzma-6b36f24d54d3dd45f274a2aebef81085.dll} +0 -0
  64. pyogrio.libs/libpng16-13928571ad910705eae8d7dd8eef8b11.dll +0 -0
  65. pyogrio.libs/{msvcp140-83b6a1a2fa8b1735a358b2fe13cabe4e.dll → msvcp140-46db46e967c8db2cb7a20fc75872a57e.dll} +0 -0
  66. pyogrio.libs/proj-8a30239ef2dfc3b9dd2bb48e8abb330f.dll +0 -0
  67. pyogrio.libs/{qhull_r-99ae8a526357acc44b162cb4df2c3bb6.dll → qhull_r-c45abde5d0c92faf723cc2942138af77.dll} +0 -0
  68. pyogrio.libs/sqlite3-df30c3cf230727e23c43c40126a530f7.dll +0 -0
  69. pyogrio.libs/{tiff-7c2d4b204ec2db46c81f6a597895c2f7.dll → tiff-43630f30487a9015213475ae86ed3fa3.dll} +0 -0
  70. pyogrio.libs/{zlib1-824de9299616f0908aeeb9441a084848.dll → zlib1-e1272810861a13dd8d6cff3beac47f17.dll} +0 -0
  71. pyogrio/tests/win32.py +0 -86
  72. pyogrio-0.7.2.dist-info/DELVEWHEEL +0 -2
  73. pyogrio.libs/Lerc-d5afc4101deffe7de21241ccd4d562f6.dll +0 -0
  74. pyogrio.libs/geos-1c764a1384537a0ad2995e83d23e8642.dll +0 -0
  75. pyogrio.libs/geos_c-0d7dfdcee49efa8df585e2fb993157aa.dll +0 -0
  76. pyogrio.libs/json-c-36c91e30c4410d41c22b2010c31183e3.dll +0 -0
  77. pyogrio.libs/libcurl-ebcc8c18195071a90e59f818902e10c6.dll +0 -0
  78. pyogrio.libs/libexpat-345379c9c11632130d8c383cbacde1a6.dll +0 -0
  79. pyogrio.libs/libpng16-2c30e6846653c47ef2ff9d7dec3338ba.dll +0 -0
  80. pyogrio.libs/proj-98758c96a6cb682b5cec7e8dc5e29a50.dll +0 -0
  81. pyogrio.libs/sqlite3-327ed7b38bfd91fb4a17544960e055e9.dll +0 -0
  82. {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/LICENSE +0 -0
  83. {pyogrio-0.7.2.dist-info → pyogrio-0.9.0.dist-info}/top_level.txt +0 -0
pyogrio/_err.c CHANGED
@@ -1,4 +1,4 @@
1
- /* Generated by Cython 3.0.4 */
1
+ /* Generated by Cython 3.0.10 */
2
2
 
3
3
  /* BEGIN: Cython Metadata
4
4
  {
@@ -57,10 +57,10 @@ END: Cython Metadata */
57
57
  #else
58
58
  #define __PYX_EXTRA_ABI_MODULE_NAME ""
59
59
  #endif
60
- #define CYTHON_ABI "3_0_4" __PYX_EXTRA_ABI_MODULE_NAME
60
+ #define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME
61
61
  #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
62
62
  #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
63
- #define CYTHON_HEX_VERSION 0x030004F0
63
+ #define CYTHON_HEX_VERSION 0x03000AF0
64
64
  #define CYTHON_FUTURE_DIVISION 1
65
65
  #include <stddef.h>
66
66
  #ifndef offsetof
@@ -152,6 +152,8 @@ END: Cython Metadata */
152
152
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
153
153
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
154
154
  #endif
155
+ #undef CYTHON_USE_FREELISTS
156
+ #define CYTHON_USE_FREELISTS 0
155
157
  #elif defined(PYPY_VERSION)
156
158
  #define CYTHON_COMPILING_IN_PYPY 1
157
159
  #define CYTHON_COMPILING_IN_CPYTHON 0
@@ -213,6 +215,8 @@ END: Cython Metadata */
213
215
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
214
216
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
215
217
  #endif
218
+ #undef CYTHON_USE_FREELISTS
219
+ #define CYTHON_USE_FREELISTS 0
216
220
  #elif defined(CYTHON_LIMITED_API)
217
221
  #ifdef Py_LIMITED_API
218
222
  #undef __PYX_LIMITED_VERSION_HEX
@@ -274,7 +278,9 @@ END: Cython Metadata */
274
278
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
275
279
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
276
280
  #endif
277
- #elif defined(PY_NOGIL)
281
+ #undef CYTHON_USE_FREELISTS
282
+ #define CYTHON_USE_FREELISTS 0
283
+ #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
278
284
  #define CYTHON_COMPILING_IN_PYPY 0
279
285
  #define CYTHON_COMPILING_IN_CPYTHON 0
280
286
  #define CYTHON_COMPILING_IN_LIMITED_API 0
@@ -283,11 +289,17 @@ END: Cython Metadata */
283
289
  #ifndef CYTHON_USE_TYPE_SLOTS
284
290
  #define CYTHON_USE_TYPE_SLOTS 1
285
291
  #endif
292
+ #ifndef CYTHON_USE_TYPE_SPECS
293
+ #define CYTHON_USE_TYPE_SPECS 0
294
+ #endif
286
295
  #undef CYTHON_USE_PYTYPE_LOOKUP
287
296
  #define CYTHON_USE_PYTYPE_LOOKUP 0
288
297
  #ifndef CYTHON_USE_ASYNC_SLOTS
289
298
  #define CYTHON_USE_ASYNC_SLOTS 1
290
299
  #endif
300
+ #ifndef CYTHON_USE_PYLONG_INTERNALS
301
+ #define CYTHON_USE_PYLONG_INTERNALS 0
302
+ #endif
291
303
  #undef CYTHON_USE_PYLIST_INTERNALS
292
304
  #define CYTHON_USE_PYLIST_INTERNALS 0
293
305
  #ifndef CYTHON_USE_UNICODE_INTERNALS
@@ -295,8 +307,6 @@ END: Cython Metadata */
295
307
  #endif
296
308
  #undef CYTHON_USE_UNICODE_WRITER
297
309
  #define CYTHON_USE_UNICODE_WRITER 0
298
- #undef CYTHON_USE_PYLONG_INTERNALS
299
- #define CYTHON_USE_PYLONG_INTERNALS 0
300
310
  #ifndef CYTHON_AVOID_BORROWED_REFS
301
311
  #define CYTHON_AVOID_BORROWED_REFS 0
302
312
  #endif
@@ -308,11 +318,22 @@ END: Cython Metadata */
308
318
  #endif
309
319
  #undef CYTHON_FAST_THREAD_STATE
310
320
  #define CYTHON_FAST_THREAD_STATE 0
321
+ #undef CYTHON_FAST_GIL
322
+ #define CYTHON_FAST_GIL 0
323
+ #ifndef CYTHON_METH_FASTCALL
324
+ #define CYTHON_METH_FASTCALL 1
325
+ #endif
311
326
  #undef CYTHON_FAST_PYCALL
312
327
  #define CYTHON_FAST_PYCALL 0
328
+ #ifndef CYTHON_PEP487_INIT_SUBCLASS
329
+ #define CYTHON_PEP487_INIT_SUBCLASS 1
330
+ #endif
313
331
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
314
332
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
315
333
  #endif
334
+ #ifndef CYTHON_USE_MODULE_STATE
335
+ #define CYTHON_USE_MODULE_STATE 0
336
+ #endif
316
337
  #ifndef CYTHON_USE_TP_FINALIZE
317
338
  #define CYTHON_USE_TP_FINALIZE 1
318
339
  #endif
@@ -320,6 +341,12 @@ END: Cython Metadata */
320
341
  #define CYTHON_USE_DICT_VERSIONS 0
321
342
  #undef CYTHON_USE_EXC_INFO_STACK
322
343
  #define CYTHON_USE_EXC_INFO_STACK 0
344
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
345
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
346
+ #endif
347
+ #ifndef CYTHON_USE_FREELISTS
348
+ #define CYTHON_USE_FREELISTS 0
349
+ #endif
323
350
  #else
324
351
  #define CYTHON_COMPILING_IN_PYPY 0
325
352
  #define CYTHON_COMPILING_IN_CPYTHON 1
@@ -410,6 +437,9 @@ END: Cython Metadata */
410
437
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
411
438
  #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
412
439
  #endif
440
+ #ifndef CYTHON_USE_FREELISTS
441
+ #define CYTHON_USE_FREELISTS 1
442
+ #endif
413
443
  #endif
414
444
  #if !defined(CYTHON_FAST_PYCCALL)
415
445
  #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
@@ -602,18 +632,19 @@ END: Cython Metadata */
602
632
  PyObject *exception_table = NULL;
603
633
  PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
604
634
  #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
605
- PyObject *version_info; // borrowed
606
- #endif
635
+ PyObject *version_info;
607
636
  PyObject *py_minor_version = NULL;
637
+ #endif
608
638
  long minor_version = 0;
609
639
  PyObject *type, *value, *traceback;
610
640
  PyErr_Fetch(&type, &value, &traceback);
611
641
  #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
612
- minor_version = 11; // we don't yet need to distinguish between versions > 11
642
+ minor_version = 11;
613
643
  #else
614
644
  if (!(version_info = PySys_GetObject("version_info"))) goto end;
615
645
  if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
616
646
  minor_version = PyLong_AsLong(py_minor_version);
647
+ Py_DECREF(py_minor_version);
617
648
  if (minor_version == -1 && PyErr_Occurred()) goto end;
618
649
  #endif
619
650
  if (!(types_module = PyImport_ImportModule("types"))) goto end;
@@ -634,7 +665,6 @@ END: Cython Metadata */
634
665
  Py_XDECREF(code_type);
635
666
  Py_XDECREF(exception_table);
636
667
  Py_XDECREF(types_module);
637
- Py_XDECREF(py_minor_version);
638
668
  if (type) {
639
669
  PyErr_Restore(type, value, traceback);
640
670
  }
@@ -667,7 +697,7 @@ END: Cython Metadata */
667
697
  PyObject *fv, PyObject *cell, PyObject* fn,
668
698
  PyObject *name, int fline, PyObject *lnos) {
669
699
  PyCodeObject *result;
670
- PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here
700
+ PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
671
701
  if (!empty_bytes) return NULL;
672
702
  result =
673
703
  #if PY_VERSION_HEX >= 0x030C0000
@@ -753,8 +783,13 @@ END: Cython Metadata */
753
783
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
754
784
  Py_ssize_t nargs, PyObject *kwnames);
755
785
  #else
756
- #define __Pyx_PyCFunctionFast _PyCFunctionFast
757
- #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
786
+ #if PY_VERSION_HEX >= 0x030d00A4
787
+ # define __Pyx_PyCFunctionFast PyCFunctionFast
788
+ # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
789
+ #else
790
+ # define __Pyx_PyCFunctionFast _PyCFunctionFast
791
+ # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
792
+ #endif
758
793
  #endif
759
794
  #if CYTHON_METH_FASTCALL
760
795
  #define __Pyx_METH_FASTCALL METH_FASTCALL
@@ -829,6 +864,8 @@ static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
829
864
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
830
865
  #elif !CYTHON_FAST_THREAD_STATE
831
866
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
867
+ #elif PY_VERSION_HEX >= 0x030d00A1
868
+ #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
832
869
  #elif PY_VERSION_HEX >= 0x03060000
833
870
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
834
871
  #elif PY_VERSION_HEX >= 0x03000000
@@ -904,7 +941,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
904
941
  }
905
942
  #endif
906
943
  #endif
907
- #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
944
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
908
945
  #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
909
946
  #else
910
947
  #define __Pyx_PyDict_NewPresized(n) PyDict_New()
@@ -916,7 +953,7 @@ static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
916
953
  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
917
954
  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
918
955
  #endif
919
- #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS
956
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
920
957
  #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
921
958
  static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
922
959
  PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
@@ -960,7 +997,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
960
997
  #endif
961
998
  #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
962
999
  #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
963
- PyTypeObject *type = Py_TYPE(obj);\
1000
+ PyTypeObject *type = Py_TYPE((PyObject*)obj);\
964
1001
  assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
965
1002
  PyObject_GC_Del(obj);\
966
1003
  Py_DECREF(type);\
@@ -1104,6 +1141,15 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
1104
1141
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
1105
1142
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
1106
1143
  #endif
1144
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
1145
+ #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
1146
+ #else
1147
+ static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
1148
+ PyObject *module = PyImport_AddModule(name);
1149
+ Py_XINCREF(module);
1150
+ return module;
1151
+ }
1152
+ #endif
1107
1153
  #if PY_MAJOR_VERSION >= 3
1108
1154
  #define PyIntObject PyLongObject
1109
1155
  #define PyInt_Type PyLong_Type
@@ -1182,7 +1228,7 @@ static CYTHON_INLINE float __PYX_NAN() {
1182
1228
  #endif
1183
1229
 
1184
1230
  #define __PYX_MARK_ERR_POS(f_index, lineno) \
1185
- { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1231
+ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
1186
1232
  #define __PYX_ERR(f_index, lineno, Ln_error) \
1187
1233
  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
1188
1234
 
@@ -1297,24 +1343,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
1297
1343
  #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
1298
1344
  #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
1299
1345
  #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
1300
- #if CYTHON_COMPILING_IN_LIMITED_API
1301
- static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
1302
- {
1303
- const wchar_t *u_end = u;
1304
- while (*u_end++) ;
1305
- return (size_t)(u_end - u - 1);
1306
- }
1307
- #else
1308
- static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
1309
- {
1310
- const Py_UNICODE *u_end = u;
1311
- while (*u_end++) ;
1312
- return (size_t)(u_end - u - 1);
1313
- }
1314
- #endif
1315
1346
  #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
1316
- #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
1317
- #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
1318
1347
  #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
1319
1348
  #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
1320
1349
  #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
@@ -1364,7 +1393,7 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
1364
1393
  #endif
1365
1394
  typedef Py_ssize_t __Pyx_compact_pylong;
1366
1395
  typedef size_t __Pyx_compact_upylong;
1367
- #else // Py < 3.12
1396
+ #else
1368
1397
  #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
1369
1398
  #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
1370
1399
  #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
@@ -1505,7 +1534,7 @@ static const char *__pyx_f[] = {
1505
1534
  /*--- Type declarations ---*/
1506
1535
  struct __pyx_opt_args_7pyogrio_4_ogr_get_string;
1507
1536
 
1508
- /* "pyogrio/_ogr.pxd":388
1537
+ /* "pyogrio/_ogr.pxd":444
1509
1538
  *
1510
1539
  *
1511
1540
  * cdef get_string(const char *c_str, str encoding=*) # <<<<<<<<<<<<<<
@@ -1687,8 +1716,8 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
1687
1716
  #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
1688
1717
  #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
1689
1718
  #else
1690
- #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op
1691
- #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed
1719
+ #define __Pyx_Arg_NewRef_VARARGS(arg) arg
1720
+ #define __Pyx_Arg_XDECREF_VARARGS(arg)
1692
1721
  #endif
1693
1722
  #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
1694
1723
  #define __Pyx_KwValues_VARARGS(args, nargs) NULL
@@ -1699,9 +1728,14 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
1699
1728
  #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
1700
1729
  #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
1701
1730
  static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
1731
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
1732
+ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
1733
+ #else
1702
1734
  #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
1703
- #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs
1704
- #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array
1735
+ #endif
1736
+ #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
1737
+ to have the same reference counting */
1738
+ #define __Pyx_Arg_XDECREF_FASTCALL(arg)
1705
1739
  #else
1706
1740
  #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
1707
1741
  #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
@@ -1812,6 +1846,60 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1812
1846
  const char* encoding, const char* errors,
1813
1847
  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1814
1848
 
1849
+ /* GetTopmostException.proto */
1850
+ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
1851
+ static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1852
+ #endif
1853
+
1854
+ /* SaveResetException.proto */
1855
+ #if CYTHON_FAST_THREAD_STATE
1856
+ #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1857
+ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1858
+ #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1859
+ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1860
+ #else
1861
+ #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1862
+ #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1863
+ #endif
1864
+
1865
+ /* GetException.proto */
1866
+ #if CYTHON_FAST_THREAD_STATE
1867
+ #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1868
+ static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1869
+ #else
1870
+ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1871
+ #endif
1872
+
1873
+ /* PyObjectFormatSimple.proto */
1874
+ #if CYTHON_COMPILING_IN_PYPY
1875
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
1876
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1877
+ PyObject_Format(s, f))
1878
+ #elif PY_MAJOR_VERSION < 3
1879
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
1880
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1881
+ likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
1882
+ PyObject_Format(s, f))
1883
+ #elif CYTHON_USE_TYPE_SLOTS
1884
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
1885
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1886
+ likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
1887
+ likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
1888
+ PyObject_Format(s, f))
1889
+ #else
1890
+ #define __Pyx_PyObject_FormatSimple(s, f) (\
1891
+ likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
1892
+ PyObject_Format(s, f))
1893
+ #endif
1894
+
1895
+ /* SwapException.proto */
1896
+ #if CYTHON_FAST_THREAD_STATE
1897
+ #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1898
+ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1899
+ #else
1900
+ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1901
+ #endif
1902
+
1815
1903
  /* PyDictVersioning.proto */
1816
1904
  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1817
1905
  #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
@@ -1896,7 +1984,7 @@ static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
1896
1984
  static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1897
1985
 
1898
1986
  /* SetNameInClass.proto */
1899
- #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1987
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
1900
1988
  #define __Pyx_SetNameInClass(ns, name, value)\
1901
1989
  (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1902
1990
  #elif CYTHON_COMPILING_IN_CPYTHON
@@ -2023,7 +2111,7 @@ typedef struct {
2023
2111
  #endif
2024
2112
  void *defaults;
2025
2113
  int defaults_pyobjects;
2026
- size_t defaults_size; // used by FusedFunction for copying defaults
2114
+ size_t defaults_size;
2027
2115
  int flags;
2028
2116
  PyObject *defaults_tuple;
2029
2117
  PyObject *defaults_kwdict;
@@ -2178,6 +2266,7 @@ int __pyx_module_is_main_pyogrio___err = 0;
2178
2266
  /* Implementation of "pyogrio._err" */
2179
2267
  /* #### Code section: global_var ### */
2180
2268
  static PyObject *__pyx_builtin_property;
2269
+ static PyObject *__pyx_builtin_UnicodeDecodeError;
2181
2270
  static PyObject *__pyx_builtin_SystemExit;
2182
2271
  static PyObject *__pyx_builtin_RuntimeWarning;
2183
2272
  /* #### Code section: string_decls ### */
@@ -2241,6 +2330,7 @@ static const char __pyx_k_No_error_message[] = "No error message.";
2241
2330
  static const char __pyx_k_NullPointerError[] = "NullPointerError";
2242
2331
  static const char __pyx_k_pyogrio__err_pyx[] = "pyogrio\\_err.pyx";
2243
2332
  static const char __pyx_k_NULL_pointer_error[] = "NULL pointer error";
2333
+ static const char __pyx_k_UnicodeDecodeError[] = "UnicodeDecodeError";
2244
2334
  static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
2245
2335
  static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2246
2336
  static const char __pyx_k_CPLE_BaseError_args[] = "CPLE_BaseError.args";
@@ -2265,6 +2355,7 @@ static const char __pyx_k_Returned_from_exc_wrap_pointer[] = "\n Returned fro
2265
2355
  static const char __pyx_k_CPLE_AWSInvalidCredentialsError[] = "CPLE_AWSInvalidCredentialsError";
2266
2356
  static const char __pyx_k_Base_CPL_error_class_For_interna[] = "Base CPL error class.\n For internal use within Cython only.\n ";
2267
2357
  static const char __pyx_k_CPLE_AWSSignatureDoesNotMatchErr[] = "CPLE_AWSSignatureDoesNotMatchError";
2358
+ static const char __pyx_k_Could_not_decode_error_message_t[] = "Could not decode error message to UTF-8. Raw error: ";
2268
2359
  /* #### Code section: decls ### */
2269
2360
  static PyObject *__pyx_pf_7pyogrio_4_err_14CPLE_BaseError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_error, PyObject *__pyx_v_errno, PyObject *__pyx_v_errmsg); /* proto */
2270
2361
  static PyObject *__pyx_pf_7pyogrio_4_err_14CPLE_BaseError_2__str__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
@@ -2330,6 +2421,7 @@ typedef struct {
2330
2421
  PyObject *__pyx_n_s_CPLE_OpenFailedError;
2331
2422
  PyObject *__pyx_n_s_CPLE_OutOfMemoryError;
2332
2423
  PyObject *__pyx_n_s_CPLE_UserInterruptError;
2424
+ PyObject *__pyx_kp_u_Could_not_decode_error_message_t;
2333
2425
  PyObject *__pyx_kp_u_Fatal_error_0;
2334
2426
  PyObject *__pyx_n_s_GDALError;
2335
2427
  PyObject *__pyx_n_s_IntEnum;
@@ -2341,6 +2433,7 @@ typedef struct {
2341
2433
  PyObject *__pyx_kp_s_Returned_from_exc_wrap_pointer;
2342
2434
  PyObject *__pyx_n_s_RuntimeWarning;
2343
2435
  PyObject *__pyx_n_s_SystemExit;
2436
+ PyObject *__pyx_n_s_UnicodeDecodeError;
2344
2437
  PyObject *__pyx_kp_u_Unspecified_OGR_GDAL_error;
2345
2438
  PyObject *__pyx_kp_u__10;
2346
2439
  PyObject *__pyx_n_s__11;
@@ -2484,6 +2577,7 @@ static int __pyx_m_clear(PyObject *m) {
2484
2577
  Py_CLEAR(clear_module_state->__pyx_n_s_CPLE_OpenFailedError);
2485
2578
  Py_CLEAR(clear_module_state->__pyx_n_s_CPLE_OutOfMemoryError);
2486
2579
  Py_CLEAR(clear_module_state->__pyx_n_s_CPLE_UserInterruptError);
2580
+ Py_CLEAR(clear_module_state->__pyx_kp_u_Could_not_decode_error_message_t);
2487
2581
  Py_CLEAR(clear_module_state->__pyx_kp_u_Fatal_error_0);
2488
2582
  Py_CLEAR(clear_module_state->__pyx_n_s_GDALError);
2489
2583
  Py_CLEAR(clear_module_state->__pyx_n_s_IntEnum);
@@ -2495,6 +2589,7 @@ static int __pyx_m_clear(PyObject *m) {
2495
2589
  Py_CLEAR(clear_module_state->__pyx_kp_s_Returned_from_exc_wrap_pointer);
2496
2590
  Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeWarning);
2497
2591
  Py_CLEAR(clear_module_state->__pyx_n_s_SystemExit);
2592
+ Py_CLEAR(clear_module_state->__pyx_n_s_UnicodeDecodeError);
2498
2593
  Py_CLEAR(clear_module_state->__pyx_kp_u_Unspecified_OGR_GDAL_error);
2499
2594
  Py_CLEAR(clear_module_state->__pyx_kp_u__10);
2500
2595
  Py_CLEAR(clear_module_state->__pyx_n_s__11);
@@ -2616,6 +2711,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2616
2711
  Py_VISIT(traverse_module_state->__pyx_n_s_CPLE_OpenFailedError);
2617
2712
  Py_VISIT(traverse_module_state->__pyx_n_s_CPLE_OutOfMemoryError);
2618
2713
  Py_VISIT(traverse_module_state->__pyx_n_s_CPLE_UserInterruptError);
2714
+ Py_VISIT(traverse_module_state->__pyx_kp_u_Could_not_decode_error_message_t);
2619
2715
  Py_VISIT(traverse_module_state->__pyx_kp_u_Fatal_error_0);
2620
2716
  Py_VISIT(traverse_module_state->__pyx_n_s_GDALError);
2621
2717
  Py_VISIT(traverse_module_state->__pyx_n_s_IntEnum);
@@ -2627,6 +2723,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2627
2723
  Py_VISIT(traverse_module_state->__pyx_kp_s_Returned_from_exc_wrap_pointer);
2628
2724
  Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeWarning);
2629
2725
  Py_VISIT(traverse_module_state->__pyx_n_s_SystemExit);
2726
+ Py_VISIT(traverse_module_state->__pyx_n_s_UnicodeDecodeError);
2630
2727
  Py_VISIT(traverse_module_state->__pyx_kp_u_Unspecified_OGR_GDAL_error);
2631
2728
  Py_VISIT(traverse_module_state->__pyx_kp_u__10);
2632
2729
  Py_VISIT(traverse_module_state->__pyx_n_s__11);
@@ -2766,6 +2863,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2766
2863
  #define __pyx_n_s_CPLE_OpenFailedError __pyx_mstate_global->__pyx_n_s_CPLE_OpenFailedError
2767
2864
  #define __pyx_n_s_CPLE_OutOfMemoryError __pyx_mstate_global->__pyx_n_s_CPLE_OutOfMemoryError
2768
2865
  #define __pyx_n_s_CPLE_UserInterruptError __pyx_mstate_global->__pyx_n_s_CPLE_UserInterruptError
2866
+ #define __pyx_kp_u_Could_not_decode_error_message_t __pyx_mstate_global->__pyx_kp_u_Could_not_decode_error_message_t
2769
2867
  #define __pyx_kp_u_Fatal_error_0 __pyx_mstate_global->__pyx_kp_u_Fatal_error_0
2770
2868
  #define __pyx_n_s_GDALError __pyx_mstate_global->__pyx_n_s_GDALError
2771
2869
  #define __pyx_n_s_IntEnum __pyx_mstate_global->__pyx_n_s_IntEnum
@@ -2777,6 +2875,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2777
2875
  #define __pyx_kp_s_Returned_from_exc_wrap_pointer __pyx_mstate_global->__pyx_kp_s_Returned_from_exc_wrap_pointer
2778
2876
  #define __pyx_n_s_RuntimeWarning __pyx_mstate_global->__pyx_n_s_RuntimeWarning
2779
2877
  #define __pyx_n_s_SystemExit __pyx_mstate_global->__pyx_n_s_SystemExit
2878
+ #define __pyx_n_s_UnicodeDecodeError __pyx_mstate_global->__pyx_n_s_UnicodeDecodeError
2780
2879
  #define __pyx_kp_u_Unspecified_OGR_GDAL_error __pyx_mstate_global->__pyx_kp_u_Unspecified_OGR_GDAL_error
2781
2880
  #define __pyx_kp_u__10 __pyx_mstate_global->__pyx_kp_u__10
2782
2881
  #define __pyx_n_s__11 __pyx_mstate_global->__pyx_n_s__11
@@ -3595,17 +3694,29 @@ static CYTHON_INLINE PyObject *__pyx_f_7pyogrio_4_err_exc_check(void) {
3595
3694
  char const *__pyx_v_err_msg;
3596
3695
  PyObject *__pyx_v_msg = NULL;
3597
3696
  char const *__pyx_v_msg_b;
3697
+ CYTHON_UNUSED PyObject *__pyx_v_exc = NULL;
3598
3698
  PyObject *__pyx_r = NULL;
3599
3699
  __Pyx_RefNannyDeclarations
3600
3700
  int __pyx_t_1;
3601
- Py_ssize_t __pyx_t_2;
3701
+ PyObject *__pyx_t_2 = NULL;
3602
3702
  PyObject *__pyx_t_3 = NULL;
3603
3703
  PyObject *__pyx_t_4 = NULL;
3604
- PyObject *__pyx_t_5 = NULL;
3704
+ Py_ssize_t __pyx_t_5;
3605
3705
  PyObject *__pyx_t_6 = NULL;
3606
3706
  PyObject *__pyx_t_7 = NULL;
3607
- PyObject *__pyx_t_8 = NULL;
3608
- int __pyx_t_9;
3707
+ int __pyx_t_8;
3708
+ PyObject *__pyx_t_9 = NULL;
3709
+ PyObject *__pyx_t_10 = NULL;
3710
+ PyObject *__pyx_t_11 = NULL;
3711
+ int __pyx_t_12;
3712
+ char const *__pyx_t_13;
3713
+ PyObject *__pyx_t_14 = NULL;
3714
+ PyObject *__pyx_t_15 = NULL;
3715
+ PyObject *__pyx_t_16 = NULL;
3716
+ PyObject *__pyx_t_17 = NULL;
3717
+ PyObject *__pyx_t_18 = NULL;
3718
+ PyObject *__pyx_t_19 = NULL;
3719
+ PyObject *__pyx_t_20 = NULL;
3609
3720
  int __pyx_lineno = 0;
3610
3721
  const char *__pyx_filename = NULL;
3611
3722
  int __pyx_clineno = 0;
@@ -3681,59 +3792,203 @@ static CYTHON_INLINE PyObject *__pyx_f_7pyogrio_4_err_exc_check(void) {
3681
3792
  * else:
3682
3793
  * # Reformat messages.
3683
3794
  * msg_b = err_msg # <<<<<<<<<<<<<<
3684
- * msg = msg_b.decode('utf-8')
3685
- * msg = msg.replace("`", "'")
3795
+ *
3796
+ * try:
3686
3797
  */
3687
3798
  /*else*/ {
3688
3799
  __pyx_v_msg_b = __pyx_v_err_msg;
3689
3800
 
3690
- /* "pyogrio/_err.pyx":156
3691
- * # Reformat messages.
3801
+ /* "pyogrio/_err.pyx":157
3692
3802
  * msg_b = err_msg
3693
- * msg = msg_b.decode('utf-8') # <<<<<<<<<<<<<<
3694
- * msg = msg.replace("`", "'")
3695
- * msg = msg.replace("\n", " ")
3803
+ *
3804
+ * try: # <<<<<<<<<<<<<<
3805
+ * msg = msg_b.decode('utf-8')
3806
+ * msg = msg.replace("`", "'")
3696
3807
  */
3697
- __pyx_t_2 = __Pyx_ssize_strlen(__pyx_v_msg_b); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 156, __pyx_L1_error)
3698
- __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg_b, 0, __pyx_t_2, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
3699
- __Pyx_GOTREF(__pyx_t_3);
3700
- __pyx_v_msg = __pyx_t_3;
3701
- __pyx_t_3 = 0;
3808
+ {
3809
+ __Pyx_PyThreadState_declare
3810
+ __Pyx_PyThreadState_assign
3811
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
3812
+ __Pyx_XGOTREF(__pyx_t_2);
3813
+ __Pyx_XGOTREF(__pyx_t_3);
3814
+ __Pyx_XGOTREF(__pyx_t_4);
3815
+ /*try:*/ {
3702
3816
 
3703
- /* "pyogrio/_err.pyx":157
3817
+ /* "pyogrio/_err.pyx":158
3818
+ *
3819
+ * try:
3820
+ * msg = msg_b.decode('utf-8') # <<<<<<<<<<<<<<
3821
+ * msg = msg.replace("`", "'")
3822
+ * msg = msg.replace("\n", " ")
3823
+ */
3824
+ __pyx_t_5 = __Pyx_ssize_strlen(__pyx_v_msg_b); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 158, __pyx_L4_error)
3825
+ __pyx_t_6 = __Pyx_decode_c_string(__pyx_v_msg_b, 0, __pyx_t_5, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L4_error)
3826
+ __Pyx_GOTREF(__pyx_t_6);
3827
+ __pyx_v_msg = __pyx_t_6;
3828
+ __pyx_t_6 = 0;
3829
+
3830
+ /* "pyogrio/_err.pyx":159
3831
+ * try:
3832
+ * msg = msg_b.decode('utf-8')
3833
+ * msg = msg.replace("`", "'") # <<<<<<<<<<<<<<
3834
+ * msg = msg.replace("\n", " ")
3835
+ * except UnicodeDecodeError as exc:
3836
+ */
3837
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_msg, __pyx_n_s_replace); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L4_error)
3838
+ __Pyx_GOTREF(__pyx_t_6);
3839
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L4_error)
3840
+ __Pyx_GOTREF(__pyx_t_7);
3841
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3842
+ __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_7);
3843
+ __pyx_t_7 = 0;
3844
+
3845
+ /* "pyogrio/_err.pyx":160
3846
+ * msg = msg_b.decode('utf-8')
3847
+ * msg = msg.replace("`", "'")
3848
+ * msg = msg.replace("\n", " ") # <<<<<<<<<<<<<<
3849
+ * except UnicodeDecodeError as exc:
3850
+ * msg = f"Could not decode error message to UTF-8. Raw error: {msg_b}"
3851
+ */
3852
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_msg, __pyx_n_s_replace); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L4_error)
3853
+ __Pyx_GOTREF(__pyx_t_7);
3854
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L4_error)
3855
+ __Pyx_GOTREF(__pyx_t_6);
3856
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3857
+ __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_6);
3858
+ __pyx_t_6 = 0;
3859
+
3860
+ /* "pyogrio/_err.pyx":157
3704
3861
  * msg_b = err_msg
3705
- * msg = msg_b.decode('utf-8')
3706
- * msg = msg.replace("`", "'") # <<<<<<<<<<<<<<
3707
- * msg = msg.replace("\n", " ")
3708
3862
  *
3863
+ * try: # <<<<<<<<<<<<<<
3864
+ * msg = msg_b.decode('utf-8')
3865
+ * msg = msg.replace("`", "'")
3709
3866
  */
3710
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_msg, __pyx_n_s_replace); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
3711
- __Pyx_GOTREF(__pyx_t_3);
3712
- __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
3713
- __Pyx_GOTREF(__pyx_t_4);
3714
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3715
- __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_4);
3716
- __pyx_t_4 = 0;
3867
+ }
3868
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3869
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3870
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3871
+ goto __pyx_L9_try_end;
3872
+ __pyx_L4_error:;
3873
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3874
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3875
+
3876
+ /* "pyogrio/_err.pyx":161
3877
+ * msg = msg.replace("`", "'")
3878
+ * msg = msg.replace("\n", " ")
3879
+ * except UnicodeDecodeError as exc: # <<<<<<<<<<<<<<
3880
+ * msg = f"Could not decode error message to UTF-8. Raw error: {msg_b}"
3881
+ *
3882
+ */
3883
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
3884
+ if (__pyx_t_8) {
3885
+ __Pyx_AddTraceback("pyogrio._err.exc_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
3886
+ if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_9) < 0) __PYX_ERR(0, 161, __pyx_L6_except_error)
3887
+ __Pyx_XGOTREF(__pyx_t_6);
3888
+ __Pyx_XGOTREF(__pyx_t_7);
3889
+ __Pyx_XGOTREF(__pyx_t_9);
3890
+ __Pyx_INCREF(__pyx_t_7);
3891
+ __pyx_v_exc = __pyx_t_7;
3892
+ /*try:*/ {
3717
3893
 
3718
- /* "pyogrio/_err.pyx":158
3719
- * msg = msg_b.decode('utf-8')
3720
- * msg = msg.replace("`", "'")
3721
- * msg = msg.replace("\n", " ") # <<<<<<<<<<<<<<
3894
+ /* "pyogrio/_err.pyx":162
3895
+ * msg = msg.replace("\n", " ")
3896
+ * except UnicodeDecodeError as exc:
3897
+ * msg = f"Could not decode error message to UTF-8. Raw error: {msg_b}" # <<<<<<<<<<<<<<
3722
3898
  *
3723
3899
  * if err_type == 3:
3724
3900
  */
3725
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_msg, __pyx_n_s_replace); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
3726
- __Pyx_GOTREF(__pyx_t_4);
3727
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
3728
- __Pyx_GOTREF(__pyx_t_3);
3729
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3730
- __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_3);
3731
- __pyx_t_3 = 0;
3901
+ __pyx_t_10 = __Pyx_PyBytes_FromString(__pyx_v_msg_b); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 162, __pyx_L15_error)
3902
+ __Pyx_GOTREF(__pyx_t_10);
3903
+ __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 162, __pyx_L15_error)
3904
+ __Pyx_GOTREF(__pyx_t_11);
3905
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
3906
+ __pyx_t_10 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Could_not_decode_error_message_t, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 162, __pyx_L15_error)
3907
+ __Pyx_GOTREF(__pyx_t_10);
3908
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3909
+ __Pyx_XDECREF_SET(__pyx_v_msg, __pyx_t_10);
3910
+ __pyx_t_10 = 0;
3911
+ }
3912
+
3913
+ /* "pyogrio/_err.pyx":161
3914
+ * msg = msg.replace("`", "'")
3915
+ * msg = msg.replace("\n", " ")
3916
+ * except UnicodeDecodeError as exc: # <<<<<<<<<<<<<<
3917
+ * msg = f"Could not decode error message to UTF-8. Raw error: {msg_b}"
3918
+ *
3919
+ */
3920
+ /*finally:*/ {
3921
+ /*normal exit:*/{
3922
+ __Pyx_DECREF(__pyx_v_exc); __pyx_v_exc = 0;
3923
+ goto __pyx_L16;
3924
+ }
3925
+ __pyx_L15_error:;
3926
+ /*exception exit:*/{
3927
+ __Pyx_PyThreadState_declare
3928
+ __Pyx_PyThreadState_assign
3929
+ __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
3930
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
3931
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
3932
+ if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
3933
+ if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
3934
+ __Pyx_XGOTREF(__pyx_t_14);
3935
+ __Pyx_XGOTREF(__pyx_t_15);
3936
+ __Pyx_XGOTREF(__pyx_t_16);
3937
+ __Pyx_XGOTREF(__pyx_t_17);
3938
+ __Pyx_XGOTREF(__pyx_t_18);
3939
+ __Pyx_XGOTREF(__pyx_t_19);
3940
+ __pyx_t_8 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
3941
+ {
3942
+ __Pyx_DECREF(__pyx_v_exc); __pyx_v_exc = 0;
3943
+ }
3944
+ if (PY_MAJOR_VERSION >= 3) {
3945
+ __Pyx_XGIVEREF(__pyx_t_17);
3946
+ __Pyx_XGIVEREF(__pyx_t_18);
3947
+ __Pyx_XGIVEREF(__pyx_t_19);
3948
+ __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
3949
+ }
3950
+ __Pyx_XGIVEREF(__pyx_t_14);
3951
+ __Pyx_XGIVEREF(__pyx_t_15);
3952
+ __Pyx_XGIVEREF(__pyx_t_16);
3953
+ __Pyx_ErrRestore(__pyx_t_14, __pyx_t_15, __pyx_t_16);
3954
+ __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
3955
+ __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
3956
+ goto __pyx_L6_except_error;
3957
+ }
3958
+ __pyx_L16:;
3959
+ }
3960
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3961
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3962
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3963
+ goto __pyx_L5_exception_handled;
3964
+ }
3965
+ goto __pyx_L6_except_error;
3966
+
3967
+ /* "pyogrio/_err.pyx":157
3968
+ * msg_b = err_msg
3969
+ *
3970
+ * try: # <<<<<<<<<<<<<<
3971
+ * msg = msg_b.decode('utf-8')
3972
+ * msg = msg.replace("`", "'")
3973
+ */
3974
+ __pyx_L6_except_error:;
3975
+ __Pyx_XGIVEREF(__pyx_t_2);
3976
+ __Pyx_XGIVEREF(__pyx_t_3);
3977
+ __Pyx_XGIVEREF(__pyx_t_4);
3978
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
3979
+ goto __pyx_L1_error;
3980
+ __pyx_L5_exception_handled:;
3981
+ __Pyx_XGIVEREF(__pyx_t_2);
3982
+ __Pyx_XGIVEREF(__pyx_t_3);
3983
+ __Pyx_XGIVEREF(__pyx_t_4);
3984
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
3985
+ __pyx_L9_try_end:;
3986
+ }
3732
3987
  }
3733
3988
  __pyx_L3:;
3734
3989
 
3735
- /* "pyogrio/_err.pyx":160
3736
- * msg = msg.replace("\n", " ")
3990
+ /* "pyogrio/_err.pyx":164
3991
+ * msg = f"Could not decode error message to UTF-8. Raw error: {msg_b}"
3737
3992
  *
3738
3993
  * if err_type == 3: # <<<<<<<<<<<<<<
3739
3994
  * CPLErrorReset()
@@ -3742,7 +3997,7 @@ static CYTHON_INLINE PyObject *__pyx_f_7pyogrio_4_err_exc_check(void) {
3742
3997
  __pyx_t_1 = (__pyx_v_err_type == 3);
3743
3998
  if (__pyx_t_1) {
3744
3999
 
3745
- /* "pyogrio/_err.pyx":161
4000
+ /* "pyogrio/_err.pyx":165
3746
4001
  *
3747
4002
  * if err_type == 3:
3748
4003
  * CPLErrorReset() # <<<<<<<<<<<<<<
@@ -3751,7 +4006,7 @@ static CYTHON_INLINE PyObject *__pyx_f_7pyogrio_4_err_exc_check(void) {
3751
4006
  */
3752
4007
  CPLErrorReset();
3753
4008
 
3754
- /* "pyogrio/_err.pyx":162
4009
+ /* "pyogrio/_err.pyx":166
3755
4010
  * if err_type == 3:
3756
4011
  * CPLErrorReset()
3757
4012
  * return exception_map.get( # <<<<<<<<<<<<<<
@@ -3760,96 +4015,96 @@ static CYTHON_INLINE PyObject *__pyx_f_7pyogrio_4_err_exc_check(void) {
3760
4015
  */
3761
4016
  __Pyx_XDECREF(__pyx_r);
3762
4017
 
3763
- /* "pyogrio/_err.pyx":163
4018
+ /* "pyogrio/_err.pyx":167
3764
4019
  * CPLErrorReset()
3765
4020
  * return exception_map.get(
3766
4021
  * err_no, CPLE_BaseError)(err_type, err_no, msg) # <<<<<<<<<<<<<<
3767
4022
  *
3768
4023
  * if err_type == 4:
3769
4024
  */
3770
- __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_exception_map); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error)
3771
- __Pyx_GOTREF(__pyx_t_5);
4025
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_exception_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error)
4026
+ __Pyx_GOTREF(__pyx_t_6);
3772
4027
 
3773
- /* "pyogrio/_err.pyx":162
4028
+ /* "pyogrio/_err.pyx":166
3774
4029
  * if err_type == 3:
3775
4030
  * CPLErrorReset()
3776
4031
  * return exception_map.get( # <<<<<<<<<<<<<<
3777
4032
  * err_no, CPLE_BaseError)(err_type, err_no, msg)
3778
4033
  *
3779
4034
  */
3780
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error)
3781
- __Pyx_GOTREF(__pyx_t_6);
3782
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4035
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_get); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 166, __pyx_L1_error)
4036
+ __Pyx_GOTREF(__pyx_t_10);
4037
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3783
4038
 
3784
- /* "pyogrio/_err.pyx":163
4039
+ /* "pyogrio/_err.pyx":167
3785
4040
  * CPLErrorReset()
3786
4041
  * return exception_map.get(
3787
4042
  * err_no, CPLE_BaseError)(err_type, err_no, msg) # <<<<<<<<<<<<<<
3788
4043
  *
3789
4044
  * if err_type == 4:
3790
4045
  */
3791
- __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_err_no); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
3792
- __Pyx_GOTREF(__pyx_t_5);
3793
- __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_CPLE_BaseError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
3794
- __Pyx_GOTREF(__pyx_t_7);
3795
- __pyx_t_8 = NULL;
3796
- __pyx_t_9 = 0;
4046
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_err_no); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 167, __pyx_L1_error)
4047
+ __Pyx_GOTREF(__pyx_t_6);
4048
+ __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_CPLE_BaseError); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 167, __pyx_L1_error)
4049
+ __Pyx_GOTREF(__pyx_t_11);
4050
+ __pyx_t_20 = NULL;
4051
+ __pyx_t_12 = 0;
3797
4052
  #if CYTHON_UNPACK_METHODS
3798
- if (unlikely(PyMethod_Check(__pyx_t_6))) {
3799
- __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
3800
- if (likely(__pyx_t_8)) {
3801
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
3802
- __Pyx_INCREF(__pyx_t_8);
4053
+ if (unlikely(PyMethod_Check(__pyx_t_10))) {
4054
+ __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_10);
4055
+ if (likely(__pyx_t_20)) {
4056
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
4057
+ __Pyx_INCREF(__pyx_t_20);
3803
4058
  __Pyx_INCREF(function);
3804
- __Pyx_DECREF_SET(__pyx_t_6, function);
3805
- __pyx_t_9 = 1;
4059
+ __Pyx_DECREF_SET(__pyx_t_10, function);
4060
+ __pyx_t_12 = 1;
3806
4061
  }
3807
4062
  }
3808
4063
  #endif
3809
4064
  {
3810
- PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_t_5, __pyx_t_7};
3811
- __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
3812
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3813
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3814
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3815
- if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
3816
- __Pyx_GOTREF(__pyx_t_4);
4065
+ PyObject *__pyx_callargs[3] = {__pyx_t_20, __pyx_t_6, __pyx_t_11};
4066
+ __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_12, 2+__pyx_t_12);
4067
+ __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
3817
4068
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3818
- }
3819
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_err_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
3820
- __Pyx_GOTREF(__pyx_t_6);
3821
- __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_err_no); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
3822
- __Pyx_GOTREF(__pyx_t_7);
3823
- __pyx_t_5 = NULL;
3824
- __pyx_t_9 = 0;
4069
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4070
+ if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error)
4071
+ __Pyx_GOTREF(__pyx_t_7);
4072
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4073
+ }
4074
+ __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_err_type); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 167, __pyx_L1_error)
4075
+ __Pyx_GOTREF(__pyx_t_10);
4076
+ __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_err_no); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 167, __pyx_L1_error)
4077
+ __Pyx_GOTREF(__pyx_t_11);
4078
+ __pyx_t_6 = NULL;
4079
+ __pyx_t_12 = 0;
3825
4080
  #if CYTHON_UNPACK_METHODS
3826
- if (unlikely(PyMethod_Check(__pyx_t_4))) {
3827
- __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3828
- if (likely(__pyx_t_5)) {
3829
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3830
- __Pyx_INCREF(__pyx_t_5);
4081
+ if (unlikely(PyMethod_Check(__pyx_t_7))) {
4082
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
4083
+ if (likely(__pyx_t_6)) {
4084
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4085
+ __Pyx_INCREF(__pyx_t_6);
3831
4086
  __Pyx_INCREF(function);
3832
- __Pyx_DECREF_SET(__pyx_t_4, function);
3833
- __pyx_t_9 = 1;
4087
+ __Pyx_DECREF_SET(__pyx_t_7, function);
4088
+ __pyx_t_12 = 1;
3834
4089
  }
3835
4090
  }
3836
4091
  #endif
3837
4092
  {
3838
- PyObject *__pyx_callargs[4] = {__pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_v_msg};
3839
- __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 3+__pyx_t_9);
3840
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3841
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4093
+ PyObject *__pyx_callargs[4] = {__pyx_t_6, __pyx_t_10, __pyx_t_11, __pyx_v_msg};
4094
+ __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_12, 3+__pyx_t_12);
4095
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4096
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4097
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4098
+ if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 167, __pyx_L1_error)
4099
+ __Pyx_GOTREF(__pyx_t_9);
3842
4100
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3843
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3844
- __Pyx_GOTREF(__pyx_t_3);
3845
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3846
4101
  }
3847
- __pyx_r = __pyx_t_3;
3848
- __pyx_t_3 = 0;
4102
+ __pyx_r = __pyx_t_9;
4103
+ __pyx_t_9 = 0;
3849
4104
  goto __pyx_L0;
3850
4105
 
3851
- /* "pyogrio/_err.pyx":160
3852
- * msg = msg.replace("\n", " ")
4106
+ /* "pyogrio/_err.pyx":164
4107
+ * msg = f"Could not decode error message to UTF-8. Raw error: {msg_b}"
3853
4108
  *
3854
4109
  * if err_type == 3: # <<<<<<<<<<<<<<
3855
4110
  * CPLErrorReset()
@@ -3857,7 +4112,7 @@ static CYTHON_INLINE PyObject *__pyx_f_7pyogrio_4_err_exc_check(void) {
3857
4112
  */
3858
4113
  }
3859
4114
 
3860
- /* "pyogrio/_err.pyx":165
4115
+ /* "pyogrio/_err.pyx":169
3861
4116
  * err_no, CPLE_BaseError)(err_type, err_no, msg)
3862
4117
  *
3863
4118
  * if err_type == 4: # <<<<<<<<<<<<<<
@@ -3867,7 +4122,7 @@ static CYTHON_INLINE PyObject *__pyx_f_7pyogrio_4_err_exc_check(void) {
3867
4122
  __pyx_t_1 = (__pyx_v_err_type == 4);
3868
4123
  if (__pyx_t_1) {
3869
4124
 
3870
- /* "pyogrio/_err.pyx":166
4125
+ /* "pyogrio/_err.pyx":170
3871
4126
  *
3872
4127
  * if err_type == 4:
3873
4128
  * return SystemExit("Fatal error: {0}".format((err_type, err_no, msg))) # <<<<<<<<<<<<<<
@@ -3875,54 +4130,54 @@ static CYTHON_INLINE PyObject *__pyx_f_7pyogrio_4_err_exc_check(void) {
3875
4130
  * else:
3876
4131
  */
3877
4132
  __Pyx_XDECREF(__pyx_r);
3878
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Fatal_error_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
3879
- __Pyx_GOTREF(__pyx_t_4);
3880
- __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_err_type); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error)
4133
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Fatal_error_0, __pyx_n_s_format); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 170, __pyx_L1_error)
3881
4134
  __Pyx_GOTREF(__pyx_t_7);
3882
- __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_err_no); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error)
4135
+ __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_err_type); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 170, __pyx_L1_error)
4136
+ __Pyx_GOTREF(__pyx_t_11);
4137
+ __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_err_no); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 170, __pyx_L1_error)
4138
+ __Pyx_GOTREF(__pyx_t_10);
4139
+ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
3883
4140
  __Pyx_GOTREF(__pyx_t_6);
3884
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error)
3885
- __Pyx_GOTREF(__pyx_t_5);
3886
- __Pyx_GIVEREF(__pyx_t_7);
3887
- if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error);
3888
- __Pyx_GIVEREF(__pyx_t_6);
3889
- if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error);
4141
+ __Pyx_GIVEREF(__pyx_t_11);
4142
+ if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11)) __PYX_ERR(0, 170, __pyx_L1_error);
4143
+ __Pyx_GIVEREF(__pyx_t_10);
4144
+ if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_10)) __PYX_ERR(0, 170, __pyx_L1_error);
3890
4145
  __Pyx_INCREF(__pyx_v_msg);
3891
4146
  __Pyx_GIVEREF(__pyx_v_msg);
3892
- if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_msg)) __PYX_ERR(0, 166, __pyx_L1_error);
3893
- __pyx_t_7 = 0;
3894
- __pyx_t_6 = 0;
3895
- __pyx_t_6 = NULL;
3896
- __pyx_t_9 = 0;
4147
+ if (__Pyx_PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_msg)) __PYX_ERR(0, 170, __pyx_L1_error);
4148
+ __pyx_t_11 = 0;
4149
+ __pyx_t_10 = 0;
4150
+ __pyx_t_10 = NULL;
4151
+ __pyx_t_12 = 0;
3897
4152
  #if CYTHON_UNPACK_METHODS
3898
- if (likely(PyMethod_Check(__pyx_t_4))) {
3899
- __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
3900
- if (likely(__pyx_t_6)) {
3901
- PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3902
- __Pyx_INCREF(__pyx_t_6);
4153
+ if (likely(PyMethod_Check(__pyx_t_7))) {
4154
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
4155
+ if (likely(__pyx_t_10)) {
4156
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4157
+ __Pyx_INCREF(__pyx_t_10);
3903
4158
  __Pyx_INCREF(function);
3904
- __Pyx_DECREF_SET(__pyx_t_4, function);
3905
- __pyx_t_9 = 1;
4159
+ __Pyx_DECREF_SET(__pyx_t_7, function);
4160
+ __pyx_t_12 = 1;
3906
4161
  }
3907
4162
  }
3908
4163
  #endif
3909
4164
  {
3910
- PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_5};
3911
- __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
3912
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3913
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3914
- if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 166, __pyx_L1_error)
3915
- __Pyx_GOTREF(__pyx_t_3);
3916
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4165
+ PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_6};
4166
+ __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_12, 1+__pyx_t_12);
4167
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4168
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4169
+ if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 170, __pyx_L1_error)
4170
+ __Pyx_GOTREF(__pyx_t_9);
4171
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3917
4172
  }
3918
- __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemExit, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
3919
- __Pyx_GOTREF(__pyx_t_4);
3920
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3921
- __pyx_r = __pyx_t_4;
3922
- __pyx_t_4 = 0;
4173
+ __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_SystemExit, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 170, __pyx_L1_error)
4174
+ __Pyx_GOTREF(__pyx_t_7);
4175
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4176
+ __pyx_r = __pyx_t_7;
4177
+ __pyx_t_7 = 0;
3923
4178
  goto __pyx_L0;
3924
4179
 
3925
- /* "pyogrio/_err.pyx":165
4180
+ /* "pyogrio/_err.pyx":169
3926
4181
  * err_no, CPLE_BaseError)(err_type, err_no, msg)
3927
4182
  *
3928
4183
  * if err_type == 4: # <<<<<<<<<<<<<<
@@ -3931,7 +4186,7 @@ static CYTHON_INLINE PyObject *__pyx_f_7pyogrio_4_err_exc_check(void) {
3931
4186
  */
3932
4187
  }
3933
4188
 
3934
- /* "pyogrio/_err.pyx":169
4189
+ /* "pyogrio/_err.pyx":173
3935
4190
  *
3936
4191
  * else:
3937
4192
  * return # <<<<<<<<<<<<<<
@@ -3954,22 +4209,23 @@ static CYTHON_INLINE PyObject *__pyx_f_7pyogrio_4_err_exc_check(void) {
3954
4209
 
3955
4210
  /* function exit code */
3956
4211
  __pyx_L1_error:;
3957
- __Pyx_XDECREF(__pyx_t_3);
3958
- __Pyx_XDECREF(__pyx_t_4);
3959
- __Pyx_XDECREF(__pyx_t_5);
3960
4212
  __Pyx_XDECREF(__pyx_t_6);
3961
4213
  __Pyx_XDECREF(__pyx_t_7);
3962
- __Pyx_XDECREF(__pyx_t_8);
4214
+ __Pyx_XDECREF(__pyx_t_9);
4215
+ __Pyx_XDECREF(__pyx_t_10);
4216
+ __Pyx_XDECREF(__pyx_t_11);
4217
+ __Pyx_XDECREF(__pyx_t_20);
3963
4218
  __Pyx_AddTraceback("pyogrio._err.exc_check", __pyx_clineno, __pyx_lineno, __pyx_filename);
3964
4219
  __pyx_r = 0;
3965
4220
  __pyx_L0:;
3966
4221
  __Pyx_XDECREF(__pyx_v_msg);
4222
+ __Pyx_XDECREF(__pyx_v_exc);
3967
4223
  __Pyx_XGIVEREF(__pyx_r);
3968
4224
  __Pyx_RefNannyFinishContext();
3969
4225
  return __pyx_r;
3970
4226
  }
3971
4227
 
3972
- /* "pyogrio/_err.pyx":172
4228
+ /* "pyogrio/_err.pyx":176
3973
4229
  *
3974
4230
  *
3975
4231
  * cdef void *exc_wrap_pointer(void *ptr) except NULL: # <<<<<<<<<<<<<<
@@ -3989,7 +4245,7 @@ static void *__pyx_f_7pyogrio_4_err_exc_wrap_pointer(void *__pyx_v_ptr) {
3989
4245
  int __pyx_clineno = 0;
3990
4246
  __Pyx_RefNannySetupContext("exc_wrap_pointer", 1);
3991
4247
 
3992
- /* "pyogrio/_err.pyx":176
4248
+ /* "pyogrio/_err.pyx":180
3993
4249
  * Raises an exception if a non-fatal error has be set or if pointer is NULL.
3994
4250
  * """
3995
4251
  * if ptr == NULL: # <<<<<<<<<<<<<<
@@ -3999,29 +4255,29 @@ static void *__pyx_f_7pyogrio_4_err_exc_wrap_pointer(void *__pyx_v_ptr) {
3999
4255
  __pyx_t_1 = (__pyx_v_ptr == NULL);
4000
4256
  if (__pyx_t_1) {
4001
4257
 
4002
- /* "pyogrio/_err.pyx":177
4258
+ /* "pyogrio/_err.pyx":181
4003
4259
  * """
4004
4260
  * if ptr == NULL:
4005
4261
  * exc = exc_check() # <<<<<<<<<<<<<<
4006
4262
  * if exc:
4007
4263
  * raise exc
4008
4264
  */
4009
- __pyx_t_2 = __pyx_f_7pyogrio_4_err_exc_check(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
4265
+ __pyx_t_2 = __pyx_f_7pyogrio_4_err_exc_check(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
4010
4266
  __Pyx_GOTREF(__pyx_t_2);
4011
4267
  __pyx_v_exc = __pyx_t_2;
4012
4268
  __pyx_t_2 = 0;
4013
4269
 
4014
- /* "pyogrio/_err.pyx":178
4270
+ /* "pyogrio/_err.pyx":182
4015
4271
  * if ptr == NULL:
4016
4272
  * exc = exc_check()
4017
4273
  * if exc: # <<<<<<<<<<<<<<
4018
4274
  * raise exc
4019
4275
  * else:
4020
4276
  */
4021
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 178, __pyx_L1_error)
4277
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 182, __pyx_L1_error)
4022
4278
  if (unlikely(__pyx_t_1)) {
4023
4279
 
4024
- /* "pyogrio/_err.pyx":179
4280
+ /* "pyogrio/_err.pyx":183
4025
4281
  * exc = exc_check()
4026
4282
  * if exc:
4027
4283
  * raise exc # <<<<<<<<<<<<<<
@@ -4029,9 +4285,9 @@ static void *__pyx_f_7pyogrio_4_err_exc_wrap_pointer(void *__pyx_v_ptr) {
4029
4285
  * # null pointer was passed, but no error message from GDAL
4030
4286
  */
4031
4287
  __Pyx_Raise(__pyx_v_exc, 0, 0, 0);
4032
- __PYX_ERR(0, 179, __pyx_L1_error)
4288
+ __PYX_ERR(0, 183, __pyx_L1_error)
4033
4289
 
4034
- /* "pyogrio/_err.pyx":178
4290
+ /* "pyogrio/_err.pyx":182
4035
4291
  * if ptr == NULL:
4036
4292
  * exc = exc_check()
4037
4293
  * if exc: # <<<<<<<<<<<<<<
@@ -4040,7 +4296,7 @@ static void *__pyx_f_7pyogrio_4_err_exc_wrap_pointer(void *__pyx_v_ptr) {
4040
4296
  */
4041
4297
  }
4042
4298
 
4043
- /* "pyogrio/_err.pyx":182
4299
+ /* "pyogrio/_err.pyx":186
4044
4300
  * else:
4045
4301
  * # null pointer was passed, but no error message from GDAL
4046
4302
  * raise NullPointerError(-1, -1, "NULL pointer error") # <<<<<<<<<<<<<<
@@ -4048,17 +4304,17 @@ static void *__pyx_f_7pyogrio_4_err_exc_wrap_pointer(void *__pyx_v_ptr) {
4048
4304
  *
4049
4305
  */
4050
4306
  /*else*/ {
4051
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NullPointerError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error)
4307
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_NullPointerError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error)
4052
4308
  __Pyx_GOTREF(__pyx_t_2);
4053
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error)
4309
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
4054
4310
  __Pyx_GOTREF(__pyx_t_3);
4055
4311
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4056
4312
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4057
4313
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4058
- __PYX_ERR(0, 182, __pyx_L1_error)
4314
+ __PYX_ERR(0, 186, __pyx_L1_error)
4059
4315
  }
4060
4316
 
4061
- /* "pyogrio/_err.pyx":176
4317
+ /* "pyogrio/_err.pyx":180
4062
4318
  * Raises an exception if a non-fatal error has be set or if pointer is NULL.
4063
4319
  * """
4064
4320
  * if ptr == NULL: # <<<<<<<<<<<<<<
@@ -4067,7 +4323,7 @@ static void *__pyx_f_7pyogrio_4_err_exc_wrap_pointer(void *__pyx_v_ptr) {
4067
4323
  */
4068
4324
  }
4069
4325
 
4070
- /* "pyogrio/_err.pyx":183
4326
+ /* "pyogrio/_err.pyx":187
4071
4327
  * # null pointer was passed, but no error message from GDAL
4072
4328
  * raise NullPointerError(-1, -1, "NULL pointer error")
4073
4329
  * return ptr # <<<<<<<<<<<<<<
@@ -4077,7 +4333,7 @@ static void *__pyx_f_7pyogrio_4_err_exc_wrap_pointer(void *__pyx_v_ptr) {
4077
4333
  __pyx_r = __pyx_v_ptr;
4078
4334
  goto __pyx_L0;
4079
4335
 
4080
- /* "pyogrio/_err.pyx":172
4336
+ /* "pyogrio/_err.pyx":176
4081
4337
  *
4082
4338
  *
4083
4339
  * cdef void *exc_wrap_pointer(void *ptr) except NULL: # <<<<<<<<<<<<<<
@@ -4097,7 +4353,7 @@ static void *__pyx_f_7pyogrio_4_err_exc_wrap_pointer(void *__pyx_v_ptr) {
4097
4353
  return __pyx_r;
4098
4354
  }
4099
4355
 
4100
- /* "pyogrio/_err.pyx":186
4356
+ /* "pyogrio/_err.pyx":190
4101
4357
  *
4102
4358
  *
4103
4359
  * cdef int exc_wrap_int(int err) except -1: # <<<<<<<<<<<<<<
@@ -4117,7 +4373,7 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_int(int __pyx_v_err) {
4117
4373
  int __pyx_clineno = 0;
4118
4374
  __Pyx_RefNannySetupContext("exc_wrap_int", 1);
4119
4375
 
4120
- /* "pyogrio/_err.pyx":192
4376
+ /* "pyogrio/_err.pyx":196
4121
4377
  * Copied from Fiona (_err.pyx).
4122
4378
  * """
4123
4379
  * if err: # <<<<<<<<<<<<<<
@@ -4127,29 +4383,29 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_int(int __pyx_v_err) {
4127
4383
  __pyx_t_1 = (__pyx_v_err != 0);
4128
4384
  if (__pyx_t_1) {
4129
4385
 
4130
- /* "pyogrio/_err.pyx":193
4386
+ /* "pyogrio/_err.pyx":197
4131
4387
  * """
4132
4388
  * if err:
4133
4389
  * exc = exc_check() # <<<<<<<<<<<<<<
4134
4390
  * if exc:
4135
4391
  * raise exc
4136
4392
  */
4137
- __pyx_t_2 = __pyx_f_7pyogrio_4_err_exc_check(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
4393
+ __pyx_t_2 = __pyx_f_7pyogrio_4_err_exc_check(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
4138
4394
  __Pyx_GOTREF(__pyx_t_2);
4139
4395
  __pyx_v_exc = __pyx_t_2;
4140
4396
  __pyx_t_2 = 0;
4141
4397
 
4142
- /* "pyogrio/_err.pyx":194
4398
+ /* "pyogrio/_err.pyx":198
4143
4399
  * if err:
4144
4400
  * exc = exc_check()
4145
4401
  * if exc: # <<<<<<<<<<<<<<
4146
4402
  * raise exc
4147
4403
  * else:
4148
4404
  */
4149
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 194, __pyx_L1_error)
4405
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 198, __pyx_L1_error)
4150
4406
  if (unlikely(__pyx_t_1)) {
4151
4407
 
4152
- /* "pyogrio/_err.pyx":195
4408
+ /* "pyogrio/_err.pyx":199
4153
4409
  * exc = exc_check()
4154
4410
  * if exc:
4155
4411
  * raise exc # <<<<<<<<<<<<<<
@@ -4157,9 +4413,9 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_int(int __pyx_v_err) {
4157
4413
  * # no error message from GDAL
4158
4414
  */
4159
4415
  __Pyx_Raise(__pyx_v_exc, 0, 0, 0);
4160
- __PYX_ERR(0, 195, __pyx_L1_error)
4416
+ __PYX_ERR(0, 199, __pyx_L1_error)
4161
4417
 
4162
- /* "pyogrio/_err.pyx":194
4418
+ /* "pyogrio/_err.pyx":198
4163
4419
  * if err:
4164
4420
  * exc = exc_check()
4165
4421
  * if exc: # <<<<<<<<<<<<<<
@@ -4168,7 +4424,7 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_int(int __pyx_v_err) {
4168
4424
  */
4169
4425
  }
4170
4426
 
4171
- /* "pyogrio/_err.pyx":198
4427
+ /* "pyogrio/_err.pyx":202
4172
4428
  * else:
4173
4429
  * # no error message from GDAL
4174
4430
  * raise CPLE_BaseError(-1, -1, "Unspecified OGR / GDAL error") # <<<<<<<<<<<<<<
@@ -4176,17 +4432,17 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_int(int __pyx_v_err) {
4176
4432
  *
4177
4433
  */
4178
4434
  /*else*/ {
4179
- __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CPLE_BaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 198, __pyx_L1_error)
4435
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_CPLE_BaseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
4180
4436
  __Pyx_GOTREF(__pyx_t_2);
4181
- __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
4437
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
4182
4438
  __Pyx_GOTREF(__pyx_t_3);
4183
4439
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4184
4440
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
4185
4441
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4186
- __PYX_ERR(0, 198, __pyx_L1_error)
4442
+ __PYX_ERR(0, 202, __pyx_L1_error)
4187
4443
  }
4188
4444
 
4189
- /* "pyogrio/_err.pyx":192
4445
+ /* "pyogrio/_err.pyx":196
4190
4446
  * Copied from Fiona (_err.pyx).
4191
4447
  * """
4192
4448
  * if err: # <<<<<<<<<<<<<<
@@ -4195,7 +4451,7 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_int(int __pyx_v_err) {
4195
4451
  */
4196
4452
  }
4197
4453
 
4198
- /* "pyogrio/_err.pyx":199
4454
+ /* "pyogrio/_err.pyx":203
4199
4455
  * # no error message from GDAL
4200
4456
  * raise CPLE_BaseError(-1, -1, "Unspecified OGR / GDAL error")
4201
4457
  * return err # <<<<<<<<<<<<<<
@@ -4205,7 +4461,7 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_int(int __pyx_v_err) {
4205
4461
  __pyx_r = __pyx_v_err;
4206
4462
  goto __pyx_L0;
4207
4463
 
4208
- /* "pyogrio/_err.pyx":186
4464
+ /* "pyogrio/_err.pyx":190
4209
4465
  *
4210
4466
  *
4211
4467
  * cdef int exc_wrap_int(int err) except -1: # <<<<<<<<<<<<<<
@@ -4225,7 +4481,7 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_int(int __pyx_v_err) {
4225
4481
  return __pyx_r;
4226
4482
  }
4227
4483
 
4228
- /* "pyogrio/_err.pyx":202
4484
+ /* "pyogrio/_err.pyx":206
4229
4485
  *
4230
4486
  *
4231
4487
  * cdef int exc_wrap_ogrerr(int err) except -1: # <<<<<<<<<<<<<<
@@ -4248,7 +4504,7 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_ogrerr(int __pyx_v_err) {
4248
4504
  int __pyx_clineno = 0;
4249
4505
  __Pyx_RefNannySetupContext("exc_wrap_ogrerr", 1);
4250
4506
 
4251
- /* "pyogrio/_err.pyx":208
4507
+ /* "pyogrio/_err.pyx":212
4252
4508
  * Adapted from Fiona (_err.pyx).
4253
4509
  * """
4254
4510
  * if err != 0: # <<<<<<<<<<<<<<
@@ -4258,20 +4514,20 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_ogrerr(int __pyx_v_err) {
4258
4514
  __pyx_t_1 = (__pyx_v_err != 0);
4259
4515
  if (unlikely(__pyx_t_1)) {
4260
4516
 
4261
- /* "pyogrio/_err.pyx":209
4517
+ /* "pyogrio/_err.pyx":213
4262
4518
  * """
4263
4519
  * if err != 0:
4264
4520
  * raise CPLE_BaseError(3, err, f"OGR Error code {err}") # <<<<<<<<<<<<<<
4265
4521
  *
4266
4522
  * return err
4267
4523
  */
4268
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CPLE_BaseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 209, __pyx_L1_error)
4524
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_CPLE_BaseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
4269
4525
  __Pyx_GOTREF(__pyx_t_3);
4270
- __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
4526
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_err); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
4271
4527
  __Pyx_GOTREF(__pyx_t_4);
4272
- __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_err, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 209, __pyx_L1_error)
4528
+ __pyx_t_5 = __Pyx_PyUnicode_From_int(__pyx_v_err, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error)
4273
4529
  __Pyx_GOTREF(__pyx_t_5);
4274
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_OGR_Error_code, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error)
4530
+ __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_OGR_Error_code, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error)
4275
4531
  __Pyx_GOTREF(__pyx_t_6);
4276
4532
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4277
4533
  __pyx_t_5 = NULL;
@@ -4294,15 +4550,15 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_ogrerr(int __pyx_v_err) {
4294
4550
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4295
4551
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4296
4552
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4297
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 209, __pyx_L1_error)
4553
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
4298
4554
  __Pyx_GOTREF(__pyx_t_2);
4299
4555
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4300
4556
  }
4301
4557
  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
4302
4558
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4303
- __PYX_ERR(0, 209, __pyx_L1_error)
4559
+ __PYX_ERR(0, 213, __pyx_L1_error)
4304
4560
 
4305
- /* "pyogrio/_err.pyx":208
4561
+ /* "pyogrio/_err.pyx":212
4306
4562
  * Adapted from Fiona (_err.pyx).
4307
4563
  * """
4308
4564
  * if err != 0: # <<<<<<<<<<<<<<
@@ -4311,7 +4567,7 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_ogrerr(int __pyx_v_err) {
4311
4567
  */
4312
4568
  }
4313
4569
 
4314
- /* "pyogrio/_err.pyx":211
4570
+ /* "pyogrio/_err.pyx":215
4315
4571
  * raise CPLE_BaseError(3, err, f"OGR Error code {err}")
4316
4572
  *
4317
4573
  * return err # <<<<<<<<<<<<<<
@@ -4321,7 +4577,7 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_ogrerr(int __pyx_v_err) {
4321
4577
  __pyx_r = __pyx_v_err;
4322
4578
  goto __pyx_L0;
4323
4579
 
4324
- /* "pyogrio/_err.pyx":202
4580
+ /* "pyogrio/_err.pyx":206
4325
4581
  *
4326
4582
  *
4327
4583
  * cdef int exc_wrap_ogrerr(int err) except -1: # <<<<<<<<<<<<<<
@@ -4343,7 +4599,7 @@ static int __pyx_f_7pyogrio_4_err_exc_wrap_ogrerr(int __pyx_v_err) {
4343
4599
  return __pyx_r;
4344
4600
  }
4345
4601
 
4346
- /* "pyogrio/_err.pyx":214
4602
+ /* "pyogrio/_err.pyx":218
4347
4603
  *
4348
4604
  *
4349
4605
  * cdef void error_handler(CPLErr err_class, int err_no, const char* err_msg) nogil: # <<<<<<<<<<<<<<
@@ -4368,7 +4624,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4368
4624
  #endif
4369
4625
  __Pyx_RefNannySetupContext("error_handler", 1);
4370
4626
 
4371
- /* "pyogrio/_err.pyx":221
4627
+ /* "pyogrio/_err.pyx":225
4372
4628
  * that includes the error message.
4373
4629
  * """
4374
4630
  * if err_class == CE_Fatal: # <<<<<<<<<<<<<<
@@ -4378,7 +4634,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4378
4634
  switch (__pyx_v_err_class) {
4379
4635
  case CE_Fatal:
4380
4636
 
4381
- /* "pyogrio/_err.pyx":225
4637
+ /* "pyogrio/_err.pyx":229
4382
4638
  * # because the CPL support code does an abort() before any exception
4383
4639
  * # can be generated
4384
4640
  * CPLDefaultErrorHandler(err_class, err_no, err_msg) # <<<<<<<<<<<<<<
@@ -4387,7 +4643,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4387
4643
  */
4388
4644
  CPLDefaultErrorHandler(__pyx_v_err_class, __pyx_v_err_no, __pyx_v_err_msg);
4389
4645
 
4390
- /* "pyogrio/_err.pyx":226
4646
+ /* "pyogrio/_err.pyx":230
4391
4647
  * # can be generated
4392
4648
  * CPLDefaultErrorHandler(err_class, err_no, err_msg)
4393
4649
  * return # <<<<<<<<<<<<<<
@@ -4396,7 +4652,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4396
4652
  */
4397
4653
  goto __pyx_L0;
4398
4654
 
4399
- /* "pyogrio/_err.pyx":221
4655
+ /* "pyogrio/_err.pyx":225
4400
4656
  * that includes the error message.
4401
4657
  * """
4402
4658
  * if err_class == CE_Fatal: # <<<<<<<<<<<<<<
@@ -4406,7 +4662,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4406
4662
  break;
4407
4663
  case CE_Failure:
4408
4664
 
4409
- /* "pyogrio/_err.pyx":231
4665
+ /* "pyogrio/_err.pyx":235
4410
4666
  * # For Failures, do nothing as those are explicitly caught
4411
4667
  * # with error return codes and translated into Python exceptions
4412
4668
  * return # <<<<<<<<<<<<<<
@@ -4415,7 +4671,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4415
4671
  */
4416
4672
  goto __pyx_L0;
4417
4673
 
4418
- /* "pyogrio/_err.pyx":228
4674
+ /* "pyogrio/_err.pyx":232
4419
4675
  * return
4420
4676
  *
4421
4677
  * elif err_class == CE_Failure: # <<<<<<<<<<<<<<
@@ -4425,7 +4681,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4425
4681
  break;
4426
4682
  case CE_Warning:
4427
4683
 
4428
- /* "pyogrio/_err.pyx":234
4684
+ /* "pyogrio/_err.pyx":238
4429
4685
  *
4430
4686
  * elif err_class == CE_Warning:
4431
4687
  * with gil: # <<<<<<<<<<<<<<
@@ -4438,7 +4694,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4438
4694
  #endif
4439
4695
  /*try:*/ {
4440
4696
 
4441
- /* "pyogrio/_err.pyx":235
4697
+ /* "pyogrio/_err.pyx":239
4442
4698
  * elif err_class == CE_Warning:
4443
4699
  * with gil:
4444
4700
  * msg_b = err_msg # <<<<<<<<<<<<<<
@@ -4447,29 +4703,29 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4447
4703
  */
4448
4704
  __pyx_v_msg_b = __pyx_v_err_msg;
4449
4705
 
4450
- /* "pyogrio/_err.pyx":236
4706
+ /* "pyogrio/_err.pyx":240
4451
4707
  * with gil:
4452
4708
  * msg_b = err_msg
4453
4709
  * msg = msg_b.decode('utf-8') # <<<<<<<<<<<<<<
4454
4710
  * warnings.warn(msg, RuntimeWarning)
4455
4711
  * return
4456
4712
  */
4457
- __pyx_t_1 = __Pyx_ssize_strlen(__pyx_v_msg_b); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 236, __pyx_L4_error)
4458
- __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg_b, 0, __pyx_t_1, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L4_error)
4713
+ __pyx_t_1 = __Pyx_ssize_strlen(__pyx_v_msg_b); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 240, __pyx_L4_error)
4714
+ __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg_b, 0, __pyx_t_1, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L4_error)
4459
4715
  __Pyx_GOTREF(__pyx_t_2);
4460
4716
  __pyx_v_msg = __pyx_t_2;
4461
4717
  __pyx_t_2 = 0;
4462
4718
 
4463
- /* "pyogrio/_err.pyx":237
4719
+ /* "pyogrio/_err.pyx":241
4464
4720
  * msg_b = err_msg
4465
4721
  * msg = msg_b.decode('utf-8')
4466
4722
  * warnings.warn(msg, RuntimeWarning) # <<<<<<<<<<<<<<
4467
4723
  * return
4468
4724
  *
4469
4725
  */
4470
- __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L4_error)
4726
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_warnings); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L4_error)
4471
4727
  __Pyx_GOTREF(__pyx_t_3);
4472
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L4_error)
4728
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L4_error)
4473
4729
  __Pyx_GOTREF(__pyx_t_4);
4474
4730
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4475
4731
  __pyx_t_3 = NULL;
@@ -4490,14 +4746,14 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4490
4746
  PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_msg, __pyx_builtin_RuntimeWarning};
4491
4747
  __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_5, 2+__pyx_t_5);
4492
4748
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4493
- if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L4_error)
4749
+ if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L4_error)
4494
4750
  __Pyx_GOTREF(__pyx_t_2);
4495
4751
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4496
4752
  }
4497
4753
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4498
4754
  }
4499
4755
 
4500
- /* "pyogrio/_err.pyx":234
4756
+ /* "pyogrio/_err.pyx":238
4501
4757
  *
4502
4758
  * elif err_class == CE_Warning:
4503
4759
  * with gil: # <<<<<<<<<<<<<<
@@ -4521,7 +4777,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4521
4777
  }
4522
4778
  }
4523
4779
 
4524
- /* "pyogrio/_err.pyx":238
4780
+ /* "pyogrio/_err.pyx":242
4525
4781
  * msg = msg_b.decode('utf-8')
4526
4782
  * warnings.warn(msg, RuntimeWarning)
4527
4783
  * return # <<<<<<<<<<<<<<
@@ -4530,7 +4786,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4530
4786
  */
4531
4787
  goto __pyx_L0;
4532
4788
 
4533
- /* "pyogrio/_err.pyx":233
4789
+ /* "pyogrio/_err.pyx":237
4534
4790
  * return
4535
4791
  *
4536
4792
  * elif err_class == CE_Warning: # <<<<<<<<<<<<<<
@@ -4541,7 +4797,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4541
4797
  default: break;
4542
4798
  }
4543
4799
 
4544
- /* "pyogrio/_err.pyx":242
4800
+ /* "pyogrio/_err.pyx":246
4545
4801
  * # Fall back to the default handler for non-failure messages since
4546
4802
  * # they won't be translated into exceptions.
4547
4803
  * CPLDefaultErrorHandler(err_class, err_no, err_msg) # <<<<<<<<<<<<<<
@@ -4550,7 +4806,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4550
4806
  */
4551
4807
  CPLDefaultErrorHandler(__pyx_v_err_class, __pyx_v_err_no, __pyx_v_err_msg);
4552
4808
 
4553
- /* "pyogrio/_err.pyx":214
4809
+ /* "pyogrio/_err.pyx":218
4554
4810
  *
4555
4811
  *
4556
4812
  * cdef void error_handler(CPLErr err_class, int err_no, const char* err_msg) nogil: # <<<<<<<<<<<<<<
@@ -4582,7 +4838,7 @@ static void __pyx_f_7pyogrio_4_err_error_handler(CPLErr __pyx_v_err_class, int _
4582
4838
  #endif
4583
4839
  }
4584
4840
 
4585
- /* "pyogrio/_err.pyx":245
4841
+ /* "pyogrio/_err.pyx":249
4586
4842
  *
4587
4843
  *
4588
4844
  * def _register_error_handler(): # <<<<<<<<<<<<<<
@@ -4610,14 +4866,14 @@ static PyObject *__pyx_pf_7pyogrio_4_err__register_error_handler(CYTHON_UNUSED P
4610
4866
  __Pyx_RefNannyDeclarations
4611
4867
  __Pyx_RefNannySetupContext("_register_error_handler", 1);
4612
4868
 
4613
- /* "pyogrio/_err.pyx":246
4869
+ /* "pyogrio/_err.pyx":250
4614
4870
  *
4615
4871
  * def _register_error_handler():
4616
4872
  * CPLPushErrorHandler(<CPLErrorHandler>error_handler) # <<<<<<<<<<<<<<
4617
4873
  */
4618
4874
  CPLPushErrorHandler(((CPLErrorHandler)__pyx_f_7pyogrio_4_err_error_handler));
4619
4875
 
4620
- /* "pyogrio/_err.pyx":245
4876
+ /* "pyogrio/_err.pyx":249
4621
4877
  *
4622
4878
  *
4623
4879
  * def _register_error_handler(): # <<<<<<<<<<<<<<
@@ -4669,6 +4925,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
4669
4925
  {&__pyx_n_s_CPLE_OpenFailedError, __pyx_k_CPLE_OpenFailedError, sizeof(__pyx_k_CPLE_OpenFailedError), 0, 0, 1, 1},
4670
4926
  {&__pyx_n_s_CPLE_OutOfMemoryError, __pyx_k_CPLE_OutOfMemoryError, sizeof(__pyx_k_CPLE_OutOfMemoryError), 0, 0, 1, 1},
4671
4927
  {&__pyx_n_s_CPLE_UserInterruptError, __pyx_k_CPLE_UserInterruptError, sizeof(__pyx_k_CPLE_UserInterruptError), 0, 0, 1, 1},
4928
+ {&__pyx_kp_u_Could_not_decode_error_message_t, __pyx_k_Could_not_decode_error_message_t, sizeof(__pyx_k_Could_not_decode_error_message_t), 0, 1, 0, 0},
4672
4929
  {&__pyx_kp_u_Fatal_error_0, __pyx_k_Fatal_error_0, sizeof(__pyx_k_Fatal_error_0), 0, 1, 0, 0},
4673
4930
  {&__pyx_n_s_GDALError, __pyx_k_GDALError, sizeof(__pyx_k_GDALError), 0, 0, 1, 1},
4674
4931
  {&__pyx_n_s_IntEnum, __pyx_k_IntEnum, sizeof(__pyx_k_IntEnum), 0, 0, 1, 1},
@@ -4680,6 +4937,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
4680
4937
  {&__pyx_kp_s_Returned_from_exc_wrap_pointer, __pyx_k_Returned_from_exc_wrap_pointer, sizeof(__pyx_k_Returned_from_exc_wrap_pointer), 0, 0, 1, 0},
4681
4938
  {&__pyx_n_s_RuntimeWarning, __pyx_k_RuntimeWarning, sizeof(__pyx_k_RuntimeWarning), 0, 0, 1, 1},
4682
4939
  {&__pyx_n_s_SystemExit, __pyx_k_SystemExit, sizeof(__pyx_k_SystemExit), 0, 0, 1, 1},
4940
+ {&__pyx_n_s_UnicodeDecodeError, __pyx_k_UnicodeDecodeError, sizeof(__pyx_k_UnicodeDecodeError), 0, 0, 1, 1},
4683
4941
  {&__pyx_kp_u_Unspecified_OGR_GDAL_error, __pyx_k_Unspecified_OGR_GDAL_error, sizeof(__pyx_k_Unspecified_OGR_GDAL_error), 0, 1, 0, 0},
4684
4942
  {&__pyx_kp_u__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 1, 0, 0},
4685
4943
  {&__pyx_n_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 1},
@@ -4738,8 +4996,9 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
4738
4996
  /* #### Code section: cached_builtins ### */
4739
4997
  static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
4740
4998
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 37, __pyx_L1_error)
4741
- __pyx_builtin_SystemExit = __Pyx_GetBuiltinName(__pyx_n_s_SystemExit); if (!__pyx_builtin_SystemExit) __PYX_ERR(0, 166, __pyx_L1_error)
4742
- __pyx_builtin_RuntimeWarning = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) __PYX_ERR(0, 237, __pyx_L1_error)
4999
+ __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(0, 161, __pyx_L1_error)
5000
+ __pyx_builtin_SystemExit = __Pyx_GetBuiltinName(__pyx_n_s_SystemExit); if (!__pyx_builtin_SystemExit) __PYX_ERR(0, 170, __pyx_L1_error)
5001
+ __pyx_builtin_RuntimeWarning = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeWarning); if (!__pyx_builtin_RuntimeWarning) __PYX_ERR(0, 241, __pyx_L1_error)
4743
5002
  return 0;
4744
5003
  __pyx_L1_error:;
4745
5004
  return -1;
@@ -4750,47 +5009,47 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
4750
5009
  __Pyx_RefNannyDeclarations
4751
5010
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
4752
5011
 
4753
- /* "pyogrio/_err.pyx":157
4754
- * msg_b = err_msg
4755
- * msg = msg_b.decode('utf-8')
4756
- * msg = msg.replace("`", "'") # <<<<<<<<<<<<<<
4757
- * msg = msg.replace("\n", " ")
4758
- *
5012
+ /* "pyogrio/_err.pyx":159
5013
+ * try:
5014
+ * msg = msg_b.decode('utf-8')
5015
+ * msg = msg.replace("`", "'") # <<<<<<<<<<<<<<
5016
+ * msg = msg.replace("\n", " ")
5017
+ * except UnicodeDecodeError as exc:
4759
5018
  */
4760
- __pyx_tuple__4 = PyTuple_Pack(2, __pyx_kp_u__2, __pyx_kp_u__3); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 157, __pyx_L1_error)
5019
+ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_kp_u__2, __pyx_kp_u__3); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 159, __pyx_L1_error)
4761
5020
  __Pyx_GOTREF(__pyx_tuple__4);
4762
5021
  __Pyx_GIVEREF(__pyx_tuple__4);
4763
5022
 
4764
- /* "pyogrio/_err.pyx":158
4765
- * msg = msg_b.decode('utf-8')
4766
- * msg = msg.replace("`", "'")
4767
- * msg = msg.replace("\n", " ") # <<<<<<<<<<<<<<
4768
- *
4769
- * if err_type == 3:
5023
+ /* "pyogrio/_err.pyx":160
5024
+ * msg = msg_b.decode('utf-8')
5025
+ * msg = msg.replace("`", "'")
5026
+ * msg = msg.replace("\n", " ") # <<<<<<<<<<<<<<
5027
+ * except UnicodeDecodeError as exc:
5028
+ * msg = f"Could not decode error message to UTF-8. Raw error: {msg_b}"
4770
5029
  */
4771
- __pyx_tuple__7 = PyTuple_Pack(2, __pyx_kp_u__5, __pyx_kp_u__6); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 158, __pyx_L1_error)
5030
+ __pyx_tuple__7 = PyTuple_Pack(2, __pyx_kp_u__5, __pyx_kp_u__6); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 160, __pyx_L1_error)
4772
5031
  __Pyx_GOTREF(__pyx_tuple__7);
4773
5032
  __Pyx_GIVEREF(__pyx_tuple__7);
4774
5033
 
4775
- /* "pyogrio/_err.pyx":182
5034
+ /* "pyogrio/_err.pyx":186
4776
5035
  * else:
4777
5036
  * # null pointer was passed, but no error message from GDAL
4778
5037
  * raise NullPointerError(-1, -1, "NULL pointer error") # <<<<<<<<<<<<<<
4779
5038
  * return ptr
4780
5039
  *
4781
5040
  */
4782
- __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_kp_u_NULL_pointer_error); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 182, __pyx_L1_error)
5041
+ __pyx_tuple__8 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_kp_u_NULL_pointer_error); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 186, __pyx_L1_error)
4783
5042
  __Pyx_GOTREF(__pyx_tuple__8);
4784
5043
  __Pyx_GIVEREF(__pyx_tuple__8);
4785
5044
 
4786
- /* "pyogrio/_err.pyx":198
5045
+ /* "pyogrio/_err.pyx":202
4787
5046
  * else:
4788
5047
  * # no error message from GDAL
4789
5048
  * raise CPLE_BaseError(-1, -1, "Unspecified OGR / GDAL error") # <<<<<<<<<<<<<<
4790
5049
  * return err
4791
5050
  *
4792
5051
  */
4793
- __pyx_tuple__9 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_kp_u_Unspecified_OGR_GDAL_error); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 198, __pyx_L1_error)
5052
+ __pyx_tuple__9 = PyTuple_Pack(3, __pyx_int_neg_1, __pyx_int_neg_1, __pyx_kp_u_Unspecified_OGR_GDAL_error); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 202, __pyx_L1_error)
4794
5053
  __Pyx_GOTREF(__pyx_tuple__9);
4795
5054
  __Pyx_GIVEREF(__pyx_tuple__9);
4796
5055
 
@@ -4836,13 +5095,13 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
4836
5095
  */
4837
5096
  __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__err_pyx, __pyx_n_s_args, 37, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 37, __pyx_L1_error)
4838
5097
 
4839
- /* "pyogrio/_err.pyx":245
5098
+ /* "pyogrio/_err.pyx":249
4840
5099
  *
4841
5100
  *
4842
5101
  * def _register_error_handler(): # <<<<<<<<<<<<<<
4843
5102
  * CPLPushErrorHandler(<CPLErrorHandler>error_handler)
4844
5103
  */
4845
- __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__err_pyx, __pyx_n_s_register_error_handler, 245, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 245, __pyx_L1_error)
5104
+ __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_pyogrio__err_pyx, __pyx_n_s_register_error_handler, 249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 249, __pyx_L1_error)
4846
5105
  __Pyx_RefNannyFinishContext();
4847
5106
  return 0;
4848
5107
  __pyx_L1_error:;
@@ -5147,7 +5406,7 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__err(PyObject *__pyx_pyinit_module
5147
5406
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
5148
5407
  {
5149
5408
  int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
5150
- __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to _err pseudovariable */
5409
+ __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_err" pseudovariable */
5151
5410
  if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
5152
5411
  pystate_addmodule_run = 1;
5153
5412
  }
@@ -5159,10 +5418,8 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec__err(PyObject *__pyx_pyinit_module
5159
5418
  CYTHON_UNUSED_VAR(__pyx_t_1);
5160
5419
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
5161
5420
  Py_INCREF(__pyx_d);
5162
- __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
5163
- Py_INCREF(__pyx_b);
5164
- __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
5165
- Py_INCREF(__pyx_cython_runtime);
5421
+ __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
5422
+ __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
5166
5423
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
5167
5424
  #if CYTHON_REFNANNY
5168
5425
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
@@ -6200,15 +6457,15 @@ if (!__Pyx_RefNanny) {
6200
6457
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_exception_map, __pyx_t_4) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
6201
6458
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6202
6459
 
6203
- /* "pyogrio/_err.pyx":245
6460
+ /* "pyogrio/_err.pyx":249
6204
6461
  *
6205
6462
  *
6206
6463
  * def _register_error_handler(): # <<<<<<<<<<<<<<
6207
6464
  * CPLPushErrorHandler(<CPLErrorHandler>error_handler)
6208
6465
  */
6209
- __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_err_1_register_error_handler, 0, __pyx_n_s_register_error_handler, NULL, __pyx_n_s_pyogrio__err, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error)
6466
+ __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_7pyogrio_4_err_1_register_error_handler, 0, __pyx_n_s_register_error_handler, NULL, __pyx_n_s_pyogrio__err, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
6210
6467
  __Pyx_GOTREF(__pyx_t_4);
6211
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_register_error_handler, __pyx_t_4) < 0) __PYX_ERR(0, 245, __pyx_L1_error)
6468
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_register_error_handler, __pyx_t_4) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
6212
6469
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6213
6470
 
6214
6471
  /* "pyogrio/_err.pyx":1
@@ -6410,14 +6667,20 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject
6410
6667
  #endif
6411
6668
 
6412
6669
  /* PyObjectGetAttrStrNoError */
6670
+ #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
6413
6671
  static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
6414
6672
  __Pyx_PyThreadState_declare
6415
6673
  __Pyx_PyThreadState_assign
6416
6674
  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
6417
6675
  __Pyx_PyErr_Clear();
6418
6676
  }
6677
+ #endif
6419
6678
  static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
6420
6679
  PyObject *result;
6680
+ #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
6681
+ (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
6682
+ return result;
6683
+ #else
6421
6684
  #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
6422
6685
  PyTypeObject* tp = Py_TYPE(obj);
6423
6686
  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
@@ -6429,6 +6692,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, P
6429
6692
  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
6430
6693
  }
6431
6694
  return result;
6695
+ #endif
6432
6696
  }
6433
6697
 
6434
6698
  /* GetBuiltinName */
@@ -6644,13 +6908,31 @@ static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyO
6644
6908
  {
6645
6909
  int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
6646
6910
  if (unlikely(eq != 0)) {
6647
- if (unlikely(eq < 0)) return NULL; // error
6911
+ if (unlikely(eq < 0)) return NULL;
6648
6912
  return kwvalues[i];
6649
6913
  }
6650
6914
  }
6651
- return NULL; // not found (no exception set)
6915
+ return NULL;
6916
+ }
6917
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
6918
+ CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
6919
+ Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
6920
+ PyObject *dict;
6921
+ dict = PyDict_New();
6922
+ if (unlikely(!dict))
6923
+ return NULL;
6924
+ for (i=0; i<nkwargs; i++) {
6925
+ PyObject *key = PyTuple_GET_ITEM(kwnames, i);
6926
+ if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
6927
+ goto bad;
6928
+ }
6929
+ return dict;
6930
+ bad:
6931
+ Py_DECREF(dict);
6932
+ return NULL;
6652
6933
  }
6653
6934
  #endif
6935
+ #endif
6654
6936
 
6655
6937
  /* RaiseArgTupleInvalid */
6656
6938
  static void __Pyx_RaiseArgtupleInvalid(
@@ -6743,7 +7025,7 @@ static int __Pyx_ParseOptionalKeywords(
6743
7025
  if (*name) {
6744
7026
  values[name-argnames] = value;
6745
7027
  #if CYTHON_AVOID_BORROWED_REFS
6746
- Py_INCREF(value); // transfer ownership of value to values
7028
+ Py_INCREF(value);
6747
7029
  Py_DECREF(key);
6748
7030
  #endif
6749
7031
  key = NULL;
@@ -6762,7 +7044,7 @@ static int __Pyx_ParseOptionalKeywords(
6762
7044
  && _PyString_Eq(**name, key)) {
6763
7045
  values[name-argnames] = value;
6764
7046
  #if CYTHON_AVOID_BORROWED_REFS
6765
- value = NULL; // ownership transferred to values
7047
+ value = NULL;
6766
7048
  #endif
6767
7049
  break;
6768
7050
  }
@@ -6794,7 +7076,7 @@ static int __Pyx_ParseOptionalKeywords(
6794
7076
  if (cmp == 0) {
6795
7077
  values[name-argnames] = value;
6796
7078
  #if CYTHON_AVOID_BORROWED_REFS
6797
- value = NULL; // ownership transferred to values
7079
+ value = NULL;
6798
7080
  #endif
6799
7081
  break;
6800
7082
  }
@@ -6907,9 +7189,15 @@ static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args,
6907
7189
  PyObject *result;
6908
7190
  assert(kwargs == NULL || PyDict_Check(kwargs));
6909
7191
  nk = kwargs ? PyDict_Size(kwargs) : 0;
7192
+ #if PY_MAJOR_VERSION < 3
6910
7193
  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
6911
7194
  return NULL;
6912
7195
  }
7196
+ #else
7197
+ if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
7198
+ return NULL;
7199
+ }
7200
+ #endif
6913
7201
  if (
6914
7202
  #if PY_MAJOR_VERSION >= 3
6915
7203
  co->co_kwonlyargcount == 0 &&
@@ -6986,8 +7274,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg
6986
7274
  ternaryfunc call = Py_TYPE(func)->tp_call;
6987
7275
  if (unlikely(!call))
6988
7276
  return PyObject_Call(func, arg, kw);
7277
+ #if PY_MAJOR_VERSION < 3
6989
7278
  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
6990
7279
  return NULL;
7280
+ #else
7281
+ if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
7282
+ return NULL;
7283
+ #endif
6991
7284
  result = (*call)(func, arg, kw);
6992
7285
  Py_LeaveRecursiveCall();
6993
7286
  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
@@ -7006,8 +7299,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject
7006
7299
  PyCFunction cfunc;
7007
7300
  cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
7008
7301
  self = __Pyx_CyOrPyCFunction_GET_SELF(func);
7302
+ #if PY_MAJOR_VERSION < 3
7009
7303
  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
7010
7304
  return NULL;
7305
+ #else
7306
+ if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
7307
+ return NULL;
7308
+ #endif
7011
7309
  result = cfunc(self, arg);
7012
7310
  Py_LeaveRecursiveCall();
7013
7311
  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
@@ -7072,7 +7370,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj
7072
7370
  #endif
7073
7371
  if (kwargs == NULL) {
7074
7372
  #if CYTHON_VECTORCALL
7075
- #if Py_VERSION_HEX < 0x03090000
7373
+ #if PY_VERSION_HEX < 0x03090000
7076
7374
  vectorcallfunc f = _PyVectorcall_Function(func);
7077
7375
  #else
7078
7376
  vectorcallfunc f = PyVectorcall_Function(func);
@@ -7130,6 +7428,237 @@ static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
7130
7428
  }
7131
7429
  }
7132
7430
 
7431
+ /* GetTopmostException */
7432
+ #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
7433
+ static _PyErr_StackItem *
7434
+ __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
7435
+ {
7436
+ _PyErr_StackItem *exc_info = tstate->exc_info;
7437
+ while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
7438
+ exc_info->previous_item != NULL)
7439
+ {
7440
+ exc_info = exc_info->previous_item;
7441
+ }
7442
+ return exc_info;
7443
+ }
7444
+ #endif
7445
+
7446
+ /* SaveResetException */
7447
+ #if CYTHON_FAST_THREAD_STATE
7448
+ static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
7449
+ #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
7450
+ _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
7451
+ PyObject *exc_value = exc_info->exc_value;
7452
+ if (exc_value == NULL || exc_value == Py_None) {
7453
+ *value = NULL;
7454
+ *type = NULL;
7455
+ *tb = NULL;
7456
+ } else {
7457
+ *value = exc_value;
7458
+ Py_INCREF(*value);
7459
+ *type = (PyObject*) Py_TYPE(exc_value);
7460
+ Py_INCREF(*type);
7461
+ *tb = PyException_GetTraceback(exc_value);
7462
+ }
7463
+ #elif CYTHON_USE_EXC_INFO_STACK
7464
+ _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
7465
+ *type = exc_info->exc_type;
7466
+ *value = exc_info->exc_value;
7467
+ *tb = exc_info->exc_traceback;
7468
+ Py_XINCREF(*type);
7469
+ Py_XINCREF(*value);
7470
+ Py_XINCREF(*tb);
7471
+ #else
7472
+ *type = tstate->exc_type;
7473
+ *value = tstate->exc_value;
7474
+ *tb = tstate->exc_traceback;
7475
+ Py_XINCREF(*type);
7476
+ Py_XINCREF(*value);
7477
+ Py_XINCREF(*tb);
7478
+ #endif
7479
+ }
7480
+ static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
7481
+ #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
7482
+ _PyErr_StackItem *exc_info = tstate->exc_info;
7483
+ PyObject *tmp_value = exc_info->exc_value;
7484
+ exc_info->exc_value = value;
7485
+ Py_XDECREF(tmp_value);
7486
+ Py_XDECREF(type);
7487
+ Py_XDECREF(tb);
7488
+ #else
7489
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
7490
+ #if CYTHON_USE_EXC_INFO_STACK
7491
+ _PyErr_StackItem *exc_info = tstate->exc_info;
7492
+ tmp_type = exc_info->exc_type;
7493
+ tmp_value = exc_info->exc_value;
7494
+ tmp_tb = exc_info->exc_traceback;
7495
+ exc_info->exc_type = type;
7496
+ exc_info->exc_value = value;
7497
+ exc_info->exc_traceback = tb;
7498
+ #else
7499
+ tmp_type = tstate->exc_type;
7500
+ tmp_value = tstate->exc_value;
7501
+ tmp_tb = tstate->exc_traceback;
7502
+ tstate->exc_type = type;
7503
+ tstate->exc_value = value;
7504
+ tstate->exc_traceback = tb;
7505
+ #endif
7506
+ Py_XDECREF(tmp_type);
7507
+ Py_XDECREF(tmp_value);
7508
+ Py_XDECREF(tmp_tb);
7509
+ #endif
7510
+ }
7511
+ #endif
7512
+
7513
+ /* GetException */
7514
+ #if CYTHON_FAST_THREAD_STATE
7515
+ static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
7516
+ #else
7517
+ static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
7518
+ #endif
7519
+ {
7520
+ PyObject *local_type = NULL, *local_value, *local_tb = NULL;
7521
+ #if CYTHON_FAST_THREAD_STATE
7522
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
7523
+ #if PY_VERSION_HEX >= 0x030C00A6
7524
+ local_value = tstate->current_exception;
7525
+ tstate->current_exception = 0;
7526
+ if (likely(local_value)) {
7527
+ local_type = (PyObject*) Py_TYPE(local_value);
7528
+ Py_INCREF(local_type);
7529
+ local_tb = PyException_GetTraceback(local_value);
7530
+ }
7531
+ #else
7532
+ local_type = tstate->curexc_type;
7533
+ local_value = tstate->curexc_value;
7534
+ local_tb = tstate->curexc_traceback;
7535
+ tstate->curexc_type = 0;
7536
+ tstate->curexc_value = 0;
7537
+ tstate->curexc_traceback = 0;
7538
+ #endif
7539
+ #else
7540
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
7541
+ #endif
7542
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
7543
+ #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
7544
+ if (unlikely(tstate->current_exception))
7545
+ #elif CYTHON_FAST_THREAD_STATE
7546
+ if (unlikely(tstate->curexc_type))
7547
+ #else
7548
+ if (unlikely(PyErr_Occurred()))
7549
+ #endif
7550
+ goto bad;
7551
+ #if PY_MAJOR_VERSION >= 3
7552
+ if (local_tb) {
7553
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
7554
+ goto bad;
7555
+ }
7556
+ #endif
7557
+ Py_XINCREF(local_tb);
7558
+ Py_XINCREF(local_type);
7559
+ Py_XINCREF(local_value);
7560
+ *type = local_type;
7561
+ *value = local_value;
7562
+ *tb = local_tb;
7563
+ #if CYTHON_FAST_THREAD_STATE
7564
+ #if CYTHON_USE_EXC_INFO_STACK
7565
+ {
7566
+ _PyErr_StackItem *exc_info = tstate->exc_info;
7567
+ #if PY_VERSION_HEX >= 0x030B00a4
7568
+ tmp_value = exc_info->exc_value;
7569
+ exc_info->exc_value = local_value;
7570
+ tmp_type = NULL;
7571
+ tmp_tb = NULL;
7572
+ Py_XDECREF(local_type);
7573
+ Py_XDECREF(local_tb);
7574
+ #else
7575
+ tmp_type = exc_info->exc_type;
7576
+ tmp_value = exc_info->exc_value;
7577
+ tmp_tb = exc_info->exc_traceback;
7578
+ exc_info->exc_type = local_type;
7579
+ exc_info->exc_value = local_value;
7580
+ exc_info->exc_traceback = local_tb;
7581
+ #endif
7582
+ }
7583
+ #else
7584
+ tmp_type = tstate->exc_type;
7585
+ tmp_value = tstate->exc_value;
7586
+ tmp_tb = tstate->exc_traceback;
7587
+ tstate->exc_type = local_type;
7588
+ tstate->exc_value = local_value;
7589
+ tstate->exc_traceback = local_tb;
7590
+ #endif
7591
+ Py_XDECREF(tmp_type);
7592
+ Py_XDECREF(tmp_value);
7593
+ Py_XDECREF(tmp_tb);
7594
+ #else
7595
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
7596
+ #endif
7597
+ return 0;
7598
+ bad:
7599
+ *type = 0;
7600
+ *value = 0;
7601
+ *tb = 0;
7602
+ Py_XDECREF(local_type);
7603
+ Py_XDECREF(local_value);
7604
+ Py_XDECREF(local_tb);
7605
+ return -1;
7606
+ }
7607
+
7608
+ /* SwapException */
7609
+ #if CYTHON_FAST_THREAD_STATE
7610
+ static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
7611
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
7612
+ #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
7613
+ _PyErr_StackItem *exc_info = tstate->exc_info;
7614
+ tmp_value = exc_info->exc_value;
7615
+ exc_info->exc_value = *value;
7616
+ if (tmp_value == NULL || tmp_value == Py_None) {
7617
+ Py_XDECREF(tmp_value);
7618
+ tmp_value = NULL;
7619
+ tmp_type = NULL;
7620
+ tmp_tb = NULL;
7621
+ } else {
7622
+ tmp_type = (PyObject*) Py_TYPE(tmp_value);
7623
+ Py_INCREF(tmp_type);
7624
+ #if CYTHON_COMPILING_IN_CPYTHON
7625
+ tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
7626
+ Py_XINCREF(tmp_tb);
7627
+ #else
7628
+ tmp_tb = PyException_GetTraceback(tmp_value);
7629
+ #endif
7630
+ }
7631
+ #elif CYTHON_USE_EXC_INFO_STACK
7632
+ _PyErr_StackItem *exc_info = tstate->exc_info;
7633
+ tmp_type = exc_info->exc_type;
7634
+ tmp_value = exc_info->exc_value;
7635
+ tmp_tb = exc_info->exc_traceback;
7636
+ exc_info->exc_type = *type;
7637
+ exc_info->exc_value = *value;
7638
+ exc_info->exc_traceback = *tb;
7639
+ #else
7640
+ tmp_type = tstate->exc_type;
7641
+ tmp_value = tstate->exc_value;
7642
+ tmp_tb = tstate->exc_traceback;
7643
+ tstate->exc_type = *type;
7644
+ tstate->exc_value = *value;
7645
+ tstate->exc_traceback = *tb;
7646
+ #endif
7647
+ *type = tmp_type;
7648
+ *value = tmp_value;
7649
+ *tb = tmp_tb;
7650
+ }
7651
+ #else
7652
+ static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
7653
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
7654
+ PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
7655
+ PyErr_SetExcInfo(*type, *value, *tb);
7656
+ *type = tmp_type;
7657
+ *value = tmp_value;
7658
+ *tb = tmp_tb;
7659
+ }
7660
+ #endif
7661
+
7133
7662
  /* PyDictVersioning */
7134
7663
  #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
7135
7664
  static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
@@ -7165,7 +7694,7 @@ static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
7165
7694
  {
7166
7695
  PyObject *result;
7167
7696
  #if !CYTHON_AVOID_BORROWED_REFS
7168
- #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
7697
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
7169
7698
  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
7170
7699
  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
7171
7700
  if (likely(result)) {
@@ -8200,10 +8729,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
8200
8729
 
8201
8730
  /* FetchSharedCythonModule */
8202
8731
  static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
8203
- PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME);
8204
- if (unlikely(!abi_module)) return NULL;
8205
- Py_INCREF(abi_module);
8206
- return abi_module;
8732
+ return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
8207
8733
  }
8208
8734
 
8209
8735
  /* FetchCommonType */
@@ -9187,7 +9713,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func,
9187
9713
  default:
9188
9714
  return NULL;
9189
9715
  }
9190
- return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
9716
+ return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
9191
9717
  }
9192
9718
  static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
9193
9719
  {
@@ -9526,8 +10052,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject
9526
10052
  Py_DECREF(replace);
9527
10053
  return result;
9528
10054
  }
9529
- #if __PYX_LIMITED_VERSION_HEX < 0x030780000
9530
10055
  PyErr_Clear();
10056
+ #if __PYX_LIMITED_VERSION_HEX < 0x030780000
9531
10057
  {
9532
10058
  PyObject *compiled = NULL, *result = NULL;
9533
10059
  if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
@@ -9547,6 +10073,8 @@ static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject
9547
10073
  if (result) Py_INCREF(result);
9548
10074
  return result;
9549
10075
  }
10076
+ #else
10077
+ return NULL;
9550
10078
  #endif
9551
10079
  }
9552
10080
  static void __Pyx_AddTraceback(const char *funcname, int c_line,
@@ -9644,7 +10172,7 @@ static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
9644
10172
  #else
9645
10173
  py_code = PyCode_NewEmpty(filename, funcname, py_line);
9646
10174
  #endif
9647
- Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
10175
+ Py_XDECREF(py_funcname);
9648
10176
  return py_code;
9649
10177
  bad:
9650
10178
  Py_XDECREF(py_funcname);
@@ -9726,13 +10254,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CPLErr(CPLErr value) {
9726
10254
  {
9727
10255
  int one = 1; int little = (int)*(unsigned char *)&one;
9728
10256
  unsigned char *bytes = (unsigned char *)&value;
9729
- #if !CYTHON_COMPILING_IN_LIMITED_API
10257
+ #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
9730
10258
  return _PyLong_FromByteArray(bytes, sizeof(CPLErr),
9731
10259
  little, !is_unsigned);
9732
10260
  #else
9733
10261
  PyObject *from_bytes, *result = NULL;
9734
10262
  PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
9735
- from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes");
10263
+ from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
9736
10264
  if (!from_bytes) return NULL;
9737
10265
  py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(CPLErr));
9738
10266
  if (!py_bytes) goto limited_bad;
@@ -9740,16 +10268,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_CPLErr(CPLErr value) {
9740
10268
  if (!order_str) goto limited_bad;
9741
10269
  arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
9742
10270
  if (!arg_tuple) goto limited_bad;
9743
- kwds = PyDict_New();
9744
- if (!kwds) goto limited_bad;
9745
- if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad;
10271
+ if (!is_unsigned) {
10272
+ kwds = PyDict_New();
10273
+ if (!kwds) goto limited_bad;
10274
+ if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
10275
+ }
9746
10276
  result = PyObject_Call(from_bytes, arg_tuple, kwds);
9747
10277
  limited_bad:
9748
- Py_XDECREF(from_bytes);
9749
- Py_XDECREF(py_bytes);
9750
- Py_XDECREF(order_str);
9751
- Py_XDECREF(arg_tuple);
9752
10278
  Py_XDECREF(kwds);
10279
+ Py_XDECREF(arg_tuple);
10280
+ Py_XDECREF(order_str);
10281
+ Py_XDECREF(py_bytes);
10282
+ Py_XDECREF(from_bytes);
9753
10283
  return result;
9754
10284
  #endif
9755
10285
  }
@@ -9788,13 +10318,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
9788
10318
  {
9789
10319
  int one = 1; int little = (int)*(unsigned char *)&one;
9790
10320
  unsigned char *bytes = (unsigned char *)&value;
9791
- #if !CYTHON_COMPILING_IN_LIMITED_API
10321
+ #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
9792
10322
  return _PyLong_FromByteArray(bytes, sizeof(int),
9793
10323
  little, !is_unsigned);
9794
10324
  #else
9795
10325
  PyObject *from_bytes, *result = NULL;
9796
10326
  PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
9797
- from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes");
10327
+ from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
9798
10328
  if (!from_bytes) return NULL;
9799
10329
  py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
9800
10330
  if (!py_bytes) goto limited_bad;
@@ -9802,16 +10332,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
9802
10332
  if (!order_str) goto limited_bad;
9803
10333
  arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
9804
10334
  if (!arg_tuple) goto limited_bad;
9805
- kwds = PyDict_New();
9806
- if (!kwds) goto limited_bad;
9807
- if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad;
10335
+ if (!is_unsigned) {
10336
+ kwds = PyDict_New();
10337
+ if (!kwds) goto limited_bad;
10338
+ if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
10339
+ }
9808
10340
  result = PyObject_Call(from_bytes, arg_tuple, kwds);
9809
10341
  limited_bad:
9810
- Py_XDECREF(from_bytes);
9811
- Py_XDECREF(py_bytes);
9812
- Py_XDECREF(order_str);
9813
- Py_XDECREF(arg_tuple);
9814
10342
  Py_XDECREF(kwds);
10343
+ Py_XDECREF(arg_tuple);
10344
+ Py_XDECREF(order_str);
10345
+ Py_XDECREF(py_bytes);
10346
+ Py_XDECREF(from_bytes);
9815
10347
  return result;
9816
10348
  #endif
9817
10349
  }
@@ -9866,13 +10398,13 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
9866
10398
  {
9867
10399
  int one = 1; int little = (int)*(unsigned char *)&one;
9868
10400
  unsigned char *bytes = (unsigned char *)&value;
9869
- #if !CYTHON_COMPILING_IN_LIMITED_API
10401
+ #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
9870
10402
  return _PyLong_FromByteArray(bytes, sizeof(long),
9871
10403
  little, !is_unsigned);
9872
10404
  #else
9873
10405
  PyObject *from_bytes, *result = NULL;
9874
10406
  PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
9875
- from_bytes = PyObject_GetAttrString((PyObject*)&PyInt_Type, "from_bytes");
10407
+ from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
9876
10408
  if (!from_bytes) return NULL;
9877
10409
  py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
9878
10410
  if (!py_bytes) goto limited_bad;
@@ -9880,16 +10412,18 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
9880
10412
  if (!order_str) goto limited_bad;
9881
10413
  arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
9882
10414
  if (!arg_tuple) goto limited_bad;
9883
- kwds = PyDict_New();
9884
- if (!kwds) goto limited_bad;
9885
- if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(!is_unsigned ? Py_True : Py_False))) goto limited_bad;
10415
+ if (!is_unsigned) {
10416
+ kwds = PyDict_New();
10417
+ if (!kwds) goto limited_bad;
10418
+ if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
10419
+ }
9886
10420
  result = PyObject_Call(from_bytes, arg_tuple, kwds);
9887
10421
  limited_bad:
9888
- Py_XDECREF(from_bytes);
9889
- Py_XDECREF(py_bytes);
9890
- Py_XDECREF(order_str);
9891
- Py_XDECREF(arg_tuple);
9892
10422
  Py_XDECREF(kwds);
10423
+ Py_XDECREF(arg_tuple);
10424
+ Py_XDECREF(order_str);
10425
+ Py_XDECREF(py_bytes);
10426
+ Py_XDECREF(from_bytes);
9893
10427
  return result;
9894
10428
  #endif
9895
10429
  }
@@ -10087,7 +10621,7 @@ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
10087
10621
  #endif
10088
10622
  if (likely(v)) {
10089
10623
  int ret = -1;
10090
- #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
10624
+ #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
10091
10625
  int one = 1; int is_little = (int)*(unsigned char *)&one;
10092
10626
  unsigned char *bytes = (unsigned char *)&val;
10093
10627
  ret = _PyLong_AsByteArray((PyLongObject *)v,
@@ -10360,7 +10894,7 @@ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
10360
10894
  #endif
10361
10895
  if (likely(v)) {
10362
10896
  int ret = -1;
10363
- #if !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
10897
+ #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
10364
10898
  int one = 1; int is_little = (int)*(unsigned char *)&one;
10365
10899
  unsigned char *bytes = (unsigned char *)&val;
10366
10900
  ret = _PyLong_AsByteArray((PyLongObject *)v,
@@ -10580,7 +11114,7 @@ static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObj
10580
11114
  #endif
10581
11115
 
10582
11116
  /* CheckBinaryVersion */
10583
- static unsigned long __Pyx_get_runtime_version() {
11117
+ static unsigned long __Pyx_get_runtime_version(void) {
10584
11118
  #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
10585
11119
  return Py_Version & ~0xFFUL;
10586
11120
  #else