Nuitka-winsvc 2.5.1__cp311-cp311-win_amd64.whl → 2.5.6__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 Nuitka-winsvc might be problematic. Click here for more details.

Files changed (50) hide show
  1. {Nuitka_winsvc-2.5.1.dist-info → Nuitka_winsvc-2.5.6.dist-info}/METADATA +55 -109
  2. {Nuitka_winsvc-2.5.1.dist-info → Nuitka_winsvc-2.5.6.dist-info}/RECORD +50 -49
  3. {Nuitka_winsvc-2.5.1.dist-info → Nuitka_winsvc-2.5.6.dist-info}/WHEEL +1 -1
  4. nuitka/OptionParsing.py +6 -5
  5. nuitka/Options.py +14 -5
  6. nuitka/Version.py +1 -1
  7. nuitka/build/SconsInterface.py +2 -0
  8. nuitka/build/include/nuitka/constants.h +2 -0
  9. nuitka/build/include/nuitka/helper/dictionaries.h +10 -2
  10. nuitka/build/include/nuitka/helper/tuples.h +12 -0
  11. nuitka/build/include/nuitka/prelude.h +1 -0
  12. nuitka/build/static_src/CompiledCodeHelpers.c +2 -0
  13. nuitka/build/static_src/CompiledCoroutineType.c +1 -1
  14. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +32 -23
  15. nuitka/build/static_src/HelpersBuiltin.c +1 -1
  16. nuitka/build/static_src/HelpersDeepcopy.c +1 -0
  17. nuitka/build/static_src/HelpersDictionaries.c +14 -2
  18. nuitka/build/static_src/HelpersDictionariesGenerated.c +12 -1
  19. nuitka/build/static_src/HelpersFiles.c +1 -1
  20. nuitka/build/static_src/HelpersTuples.c +1 -1
  21. nuitka/build/static_src/MainProgram.c +24 -3
  22. nuitka/code_generation/templates/CodeTemplatesVariables.py +23 -20
  23. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +4 -1
  24. nuitka/freezer/ImportDetection.py +4 -1
  25. nuitka/freezer/IncludedDataFiles.py +10 -1
  26. nuitka/freezer/Onefile.py +1 -0
  27. nuitka/nodes/BuiltinIteratorNodes.py +1 -1
  28. nuitka/nodes/DictionaryNodes.py +1 -1
  29. nuitka/nodes/VariableAssignNodes.py +2 -1
  30. nuitka/nodes/shapes/IteratorShapes.py +71 -0
  31. nuitka/nodes/shapes/ShapeMixins.py +3 -2
  32. nuitka/nodes/shapes/StandardShapes.py +1 -50
  33. nuitka/plugins/Plugins.py +10 -0
  34. nuitka/plugins/standard/DllFilesPlugin.py +78 -2
  35. nuitka/plugins/standard/ImplicitImports.py +4 -2
  36. nuitka/plugins/standard/MatplotlibPlugin.py +1 -1
  37. nuitka/plugins/standard/OptionsNannyPlugin.py +5 -4
  38. nuitka/plugins/standard/TkinterPlugin.py +23 -3
  39. nuitka/plugins/standard/standard.nuitka-package.config.yml +65 -11
  40. nuitka/tools/environments/Virtualenv.py +13 -5
  41. nuitka/tools/podman/__main__.py +4 -2
  42. nuitka/utils/FileOperations.py +4 -1
  43. nuitka/utils/Hashing.py +5 -1
  44. nuitka/utils/SharedLibraries.py +24 -0
  45. nuitka/utils/Signing.py +9 -1
  46. {Nuitka_winsvc-2.5.1.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka-run.cmd +0 -0
  47. {Nuitka_winsvc-2.5.1.data → Nuitka_winsvc-2.5.6.data}/scripts/nuitka.cmd +0 -0
  48. {Nuitka_winsvc-2.5.1.dist-info → Nuitka_winsvc-2.5.6.dist-info}/LICENSE.txt +0 -0
  49. {Nuitka_winsvc-2.5.1.dist-info → Nuitka_winsvc-2.5.6.dist-info}/entry_points.txt +0 -0
  50. {Nuitka_winsvc-2.5.1.dist-info → Nuitka_winsvc-2.5.6.dist-info}/top_level.txt +0 -0
@@ -197,9 +197,17 @@ static Nuitka_DictEntryHandle GET_STRING_DICT_ENTRY(PyDictObject *dict, Nuitka_S
197
197
  }
198
198
 
199
199
  #else
200
- // Will be written by Nuitka_PyDictLookupStr in all cases.
201
200
  PyObject **value;
202
- NUITKA_MAY_BE_UNUSED Py_ssize_t found = Nuitka_PyDictLookupStr(dict, (PyObject *)key, hash, &value);
201
+ NUITKA_MAY_BE_UNUSED Py_ssize_t found;
202
+
203
+ // We cannot use Nuitka_PyDictLookupStr in all cases, some modules misbehave
204
+ // and put non-strings in module dictionaries.
205
+ if (unlikely(dict->ma_keys->dk_kind == DICT_KEYS_GENERAL)) {
206
+ found = Nuitka_PyDictLookup(dict, (PyObject *)key, hash, &value);
207
+ } else {
208
+ found = Nuitka_PyDictLookupStr(dict, (PyObject *)key, hash, &value);
209
+ }
210
+
203
211
  assert(found != DKIX_ERROR);
204
212
 
205
213
  return value;
@@ -34,6 +34,7 @@ extern PyObject *MAKE_TUPLE_EMPTY_VAR(PyThreadState *tstate, Py_ssize_t size);
34
34
  #endif
35
35
 
36
36
  NUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE(PyThreadState *tstate, PyObject *const *elements, Py_ssize_t size) {
37
+ assert(size > 0);
37
38
  PyObject *result = MAKE_TUPLE_EMPTY(tstate, size);
38
39
 
39
40
  for (Py_ssize_t i = 0; i < size; i++) {
@@ -43,6 +44,17 @@ NUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE(PyThreadState *tstate, PyObject
43
44
  return result;
44
45
  }
45
46
 
47
+ NUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE_VAR(PyThreadState *tstate, PyObject *const *elements,
48
+ Py_ssize_t size) {
49
+ PyObject *result = MAKE_TUPLE_EMPTY_VAR(tstate, size);
50
+
51
+ for (Py_ssize_t i = 0; i < size; i++) {
52
+ PyTuple_SET_ITEM0(result, i, elements[i]);
53
+ }
54
+
55
+ return result;
56
+ }
57
+
46
58
  NUITKA_MAY_BE_UNUSED static PyObject *MAKE_TUPLE1(PyThreadState *tstate, PyObject *element1) {
47
59
  PyObject *result = MAKE_TUPLE_EMPTY(tstate, 1);
48
60
 
@@ -195,6 +195,7 @@ NUITKA_MAY_BE_UNUSED static inline managed_static_type_state *Nuitka_PyStaticTyp
195
195
  #include <internal/pycore_intrinsics.h>
196
196
  #include <internal/pycore_modsupport.h>
197
197
  #include <internal/pycore_parking_lot.h>
198
+ #include <internal/pycore_pyatomic_ft_wrappers.h>
198
199
  #include <internal/pycore_setobject.h>
199
200
  #include <internal/pycore_time.h>
200
201
  #endif
@@ -1629,6 +1629,7 @@ wchar_t const *getBinaryDirectoryWideChars(bool resolve_symlinks) {
1629
1629
 
1630
1630
  stripFilenameW(binary_directory);
1631
1631
 
1632
+ #ifndef _NUITKA_EXPERIMENTAL_AVOID_SHORT_PATH
1632
1633
  // Query length of result first.
1633
1634
  DWORD length = GetShortPathNameW(binary_directory, NULL, 0);
1634
1635
  assert(length != 0);
@@ -1645,6 +1646,7 @@ wchar_t const *getBinaryDirectoryWideChars(bool resolve_symlinks) {
1645
1646
  appendWStringSafeW(binary_directory, short_binary_directory, sizeof(binary_directory) / sizeof(wchar_t));
1646
1647
 
1647
1648
  free(short_binary_directory);
1649
+ #endif
1648
1650
  #else
1649
1651
  appendStringSafeW(binary_directory, getBinaryDirectoryHostEncoded(true),
1650
1652
  sizeof(binary_directory) / sizeof(wchar_t));
@@ -1402,7 +1402,7 @@ static PyObject *computeCoroutineOrigin(PyThreadState *tstate, int origin_depth)
1402
1402
  frame_count += 1;
1403
1403
  }
1404
1404
 
1405
- PyObject *cr_origin = MAKE_TUPLE_EMPTY(tstate, frame_count);
1405
+ PyObject *cr_origin = MAKE_TUPLE_EMPTY_VAR(tstate, frame_count);
1406
1406
 
1407
1407
  frame = PyEval_GetFrame();
1408
1408
 
@@ -148,12 +148,15 @@ static void SET_CURRENT_EXCEPTION_GENERATOR_EXIT(PyThreadState *tstate) {
148
148
 
149
149
  #if PYTHON_VERSION >= 0x300
150
150
  static bool Nuitka_PyGen_FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue) {
151
- assert(HAS_ERROR_OCCURRED(tstate));
152
-
153
151
  #if PYTHON_VERSION < 0x3c0
154
- PyObject *value = NULL;
152
+ if (!HAS_ERROR_OCCURRED(tstate)) {
153
+ *pvalue = Py_None;
154
+ Py_INCREF_IMMORTAL(Py_None);
155
+
156
+ return true;
157
+ } else if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, tstate->curexc_type, PyExc_StopIteration)) {
158
+ PyObject *value = NULL;
155
159
 
156
- if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, tstate->curexc_type, PyExc_StopIteration)) {
157
160
  PyObject *exception_type, *exception_value;
158
161
  PyTracebackObject *exception_tb;
159
162
 
@@ -185,38 +188,44 @@ static bool Nuitka_PyGen_FetchStopIterationValue(PyThreadState *tstate, PyObject
185
188
 
186
189
  Py_XDECREF(exception_type);
187
190
  Py_XDECREF(exception_tb);
188
- } else if (HAS_ERROR_OCCURRED(tstate)) {
189
- return false;
190
- }
191
191
 
192
- if (value == NULL) {
193
- value = Py_None;
194
- Py_INCREF(value);
195
- }
192
+ if (value == NULL) {
193
+ value = Py_None;
194
+ Py_INCREF(value);
195
+ }
196
196
 
197
- *pvalue = value;
197
+ *pvalue = value;
198
198
 
199
- return true;
199
+ return true;
200
+ } else {
201
+ return false;
202
+ }
200
203
  #else
201
- PyObject *value = NULL;
204
+ if (!HAS_ERROR_OCCURRED(tstate)) {
205
+ *pvalue = Py_None;
206
+ Py_INCREF_IMMORTAL(Py_None);
207
+
208
+ return true;
209
+ } else if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, tstate->current_exception, PyExc_StopIteration)) {
210
+ PyObject *value = NULL;
202
211
 
203
- if (EXCEPTION_MATCH_BOOL_SINGLE(tstate, tstate->current_exception, PyExc_StopIteration)) {
204
212
  PyObject *exc = tstate->current_exception;
205
213
  tstate->current_exception = NULL;
206
214
 
207
215
  value = Py_NewRef(((PyStopIterationObject *)exc)->value);
208
216
  Py_DECREF(exc);
209
- } else if (HAS_ERROR_OCCURRED(tstate)) {
210
- return false;
211
- }
212
217
 
213
- if (value == NULL) {
214
- value = Py_None;
215
- }
218
+ if (value == NULL) {
219
+ value = Py_None;
220
+ }
221
+
222
+ *pvalue = value;
216
223
 
217
- *pvalue = value;
224
+ return true;
218
225
 
219
- return true;
226
+ } else {
227
+ return false;
228
+ }
220
229
  #endif
221
230
  }
222
231
  #endif
@@ -48,7 +48,7 @@ PyObject *CALL_BUILTIN_KW_ARGS(PyThreadState *tstate, PyObject *callable, PyObje
48
48
  i++;
49
49
  }
50
50
 
51
- PyObject *args_tuple = MAKE_TUPLE(tstate, args, usable_args);
51
+ PyObject *args_tuple = MAKE_TUPLE_VAR(tstate, args, usable_args);
52
52
 
53
53
  PyObject *result = CALL_FUNCTION(tstate, callable, args_tuple, kw_dict);
54
54
  Py_XDECREF(kw_dict);
@@ -594,6 +594,7 @@ static PyObject *_DEEP_COPY_TUPLE_GUIDED(PyThreadState *tstate, PyObject *value,
594
594
  Py_ssize_t size = PyTuple_GET_SIZE(value);
595
595
 
596
596
  // We cannot have size 0, so this is safe.
597
+ assert(size > 0);
597
598
  PyObject *result = MAKE_TUPLE_EMPTY(tstate, size);
598
599
 
599
600
  for (Py_ssize_t i = 0; i < size; i++) {
@@ -1015,9 +1015,14 @@ void DICT_CLEAR(PyObject *dict) {
1015
1015
  #if PYTHON_VERSION >= 0x3b0
1016
1016
  static inline int Nuitka_py_get_index_from_order(PyDictObject *mp, Py_ssize_t i) {
1017
1017
  assert(mp->ma_used <= SHARED_KEYS_MAX_SIZE);
1018
+ #if PYTHON_VERSION < 0x3d0
1018
1019
  assert(i < (((char *)mp->ma_values)[-2]));
1019
-
1020
1020
  return ((char *)mp->ma_values)[-3 - i];
1021
+ #else
1022
+ assert(i < mp->ma_values->size);
1023
+ uint8_t *array = get_insertion_order_array(mp->ma_values);
1024
+ return array[i];
1025
+ #endif
1021
1026
  }
1022
1027
  #endif
1023
1028
 
@@ -1049,7 +1054,14 @@ static inline Py_ssize_t Nuitka_Py_dictkeys_get_index(const PyDictKeysObject *ke
1049
1054
  return ix;
1050
1055
  }
1051
1056
 
1052
- static inline Py_hash_t Nuitka_Py_unicode_get_hash(PyObject *o) { return _PyASCIIObject_CAST(o)->hash; }
1057
+ static inline Py_hash_t Nuitka_Py_unicode_get_hash(PyObject *o) {
1058
+ #if PYTHON_VERSION < 0x3d0
1059
+ return _PyASCIIObject_CAST(o)->hash;
1060
+ #else
1061
+ assert(PyUnicode_CheckExact(o));
1062
+ return FT_ATOMIC_LOAD_SSIZE_RELAXED(_PyASCIIObject_CAST(o)->hash);
1063
+ #endif
1064
+ }
1053
1065
 
1054
1066
  // From CPython
1055
1067
  #define PERTURB_SHIFT 5
@@ -75,7 +75,11 @@ PyObject *DICT_COPY(PyThreadState *tstate, PyObject *dict_value) {
75
75
  assert(result_mp != NULL);
76
76
  result = (PyObject *)result_mp;
77
77
 
78
+ #if PYTHON_VERSION < 0x3b0
78
79
  Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);
80
+ #else
81
+ Py_ssize_t size = dict_mp->ma_keys->dk_nentries + dict_mp->ma_keys->dk_usable;
82
+ #endif
79
83
 
80
84
  PyDictValues *new_values = _Nuitka_PyDict_new_values(size);
81
85
  assert(new_values != NULL);
@@ -289,7 +293,11 @@ PyObject *DEEP_COPY_DICT(PyThreadState *tstate, PyObject *dict_value) {
289
293
  assert(result_mp != NULL);
290
294
  result = (PyObject *)result_mp;
291
295
 
296
+ #if PYTHON_VERSION < 0x3b0
292
297
  Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);
298
+ #else
299
+ Py_ssize_t size = dict_mp->ma_keys->dk_nentries + dict_mp->ma_keys->dk_usable;
300
+ #endif
293
301
 
294
302
  PyDictValues *new_values = _Nuitka_PyDict_new_values(size);
295
303
  assert(new_values != NULL);
@@ -514,8 +522,11 @@ static PyObject *COPY_DICT_KW(PyThreadState *tstate, PyObject *dict_value) {
514
522
  assert(result_mp != NULL);
515
523
  result = (PyObject *)result_mp;
516
524
 
525
+ #if PYTHON_VERSION < 0x3b0
517
526
  Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);
518
-
527
+ #else
528
+ Py_ssize_t size = dict_mp->ma_keys->dk_nentries + dict_mp->ma_keys->dk_usable;
529
+ #endif
519
530
  #if PYTHON_VERSION < 0x3b0
520
531
  for (Py_ssize_t i = 0; i < size; i++) {
521
532
  PyDictKeyEntry *entry = &DK_ENTRIES(dict_mp->ma_keys)[i];
@@ -246,7 +246,7 @@ extern PyObject *OS_LSTAT(PyThreadState *tstate, PyObject *path, PyObject *dir_f
246
246
 
247
247
  assert(path != NULL);
248
248
  assert(dir_fd == NULL);
249
- PyObject *stat_func = LOOKUP_ATTRIBUTE(tstate, IMPORT_HARD_OS(), const_str_plain_stat);
249
+ PyObject *stat_func = LOOKUP_ATTRIBUTE(tstate, IMPORT_HARD_OS(), const_str_plain_lstat);
250
250
 
251
251
  result = CALL_FUNCTION_WITH_SINGLE_ARG(tstate, stat_func, path);
252
252
 
@@ -117,7 +117,7 @@ PyObject *TUPLE_COPY(PyThreadState *tstate, PyObject *tuple) {
117
117
  assert(PyTuple_CheckExact(tuple));
118
118
 
119
119
  Py_ssize_t size = PyTuple_GET_SIZE(tuple);
120
- PyObject *result = MAKE_TUPLE_EMPTY(tstate, size);
120
+ PyObject *result = MAKE_TUPLE_EMPTY_VAR(tstate, size);
121
121
 
122
122
  if (unlikely(result == NULL)) {
123
123
  return NULL;
@@ -16,6 +16,10 @@
16
16
  #include <windows.h>
17
17
  #endif
18
18
 
19
+ #if defined(__APPLE__)
20
+ #include <unistd.h>
21
+ #endif
22
+
19
23
  #include "nuitka/prelude.h"
20
24
 
21
25
  #ifndef __IDE_ONLY__
@@ -1219,6 +1223,19 @@ int main(int argc, char **argv) {
1219
1223
  inheritAttachedConsole();
1220
1224
  #endif
1221
1225
 
1226
+ #ifdef _NUITKA_MACOS_BUNDLE
1227
+ {
1228
+ char *current_dir = getcwd(NULL, -1);
1229
+
1230
+ if (strcmp(current_dir, "/") == 0) {
1231
+ chdir(getBinaryDirectoryHostEncoded(false));
1232
+ chdir("../../../");
1233
+ }
1234
+
1235
+ free(current_dir);
1236
+ }
1237
+ #endif
1238
+
1222
1239
  // Set up stdout/stderr according to user specification.
1223
1240
  #if NUITKA_STANDARD_HANDLES_EARLY == 1
1224
1241
  #if defined(NUITKA_FORCED_STDOUT_PATH)
@@ -1334,15 +1351,19 @@ int main(int argc, char **argv) {
1334
1351
  /* Initial command line handling only. */
1335
1352
 
1336
1353
  // Make sure, we use the absolute program path for argv[0]
1337
- #if !defined(_NUITKA_ONEFILE_MODE) && _NUITKA_NATIVE_WCHAR_ARGV == 0
1354
+ #if _NUITKA_NATIVE_WCHAR_ARGV == 0
1338
1355
  original_argv0 = argv[0];
1356
+ #if !defined(_NUITKA_ONEFILE_MODE)
1339
1357
  argv[0] = (char *)getBinaryFilenameHostEncoded(false);
1340
1358
  #endif
1359
+ #endif
1341
1360
 
1342
1361
  #if defined(_NUITKA_ONEFILE_MODE)
1343
1362
  {
1344
1363
  environment_char_t const *parent_original_argv0 = getEnvironmentVariable("NUITKA_ORIGINAL_ARGV0");
1345
1364
 
1365
+ // If forked from the parent process, it's set, otherwise fall back
1366
+ // to standalone executable binary name as set above.
1346
1367
  if (parent_original_argv0 != NULL) {
1347
1368
  original_argv0 = strdupFilename(parent_original_argv0);
1348
1369
 
@@ -1362,9 +1383,9 @@ orig_argv = argv;
1362
1383
  #endif
1363
1384
 
1364
1385
  // Make sure, we use the absolute program path for argv[0]
1365
- #if !defined(_NUITKA_ONEFILE_MODE) && _NUITKA_NATIVE_WCHAR_ARGV == 1
1386
+ #if _NUITKA_NATIVE_WCHAR_ARGV == 1
1366
1387
  original_argv0 = argv[0];
1367
- #if PYTHON_VERSION >= 0x300
1388
+ #if PYTHON_VERSION >= 0x300 && !defined(_NUITKA_ONEFILE_MODE)
1368
1389
  orig_argv[0] = (wchar_t *)getBinaryFilenameWideChars(false);
1369
1390
  #endif
1370
1391
  #endif
@@ -313,41 +313,44 @@ static PyObject *%(accessor_function_name)s(PyThreadState *tstate) {
313
313
  static Py_ssize_t cache_dk_index = 0;
314
314
 
315
315
  PyDictKeysObject *dk = moduledict_%(module_identifier)s->ma_keys;
316
- assert(DK_IS_UNICODE(dk));
316
+ if (likely(DK_IS_UNICODE(dk))) {
317
317
 
318
318
  #if PYTHON_VERSION >= 0x3c0
319
- uint32_t current_dk_version = _Nuitka_PyDictKeys_GetVersionForCurrentState(tstate->interp, dk);
319
+ uint32_t current_dk_version = _Nuitka_PyDictKeys_GetVersionForCurrentState(tstate->interp, dk);
320
320
  #else
321
- uint32_t current_dk_version = _Nuitka_PyDictKeys_GetVersionForCurrentState(dk);
321
+ uint32_t current_dk_version = _Nuitka_PyDictKeys_GetVersionForCurrentState(dk);
322
322
  #endif
323
323
 
324
- if (current_dk_version != dict_keys_version) {
325
- dict_keys_version = current_dk_version;
326
- Py_hash_t hash = ((Nuitka_StringObject *)%(var_name)s)->_base._base.hash;
327
- assert(hash != -1);
324
+ if (current_dk_version != dict_keys_version) {
325
+ dict_keys_version = current_dk_version;
326
+ Py_hash_t hash = ((Nuitka_StringObject *)%(var_name)s)->_base._base.hash;
327
+ assert(hash != -1);
328
328
 
329
- cache_dk_index = Nuitka_Py_unicodekeys_lookup_unicode(dk, %(var_name)s, hash);
330
- }
329
+ cache_dk_index = Nuitka_Py_unicodekeys_lookup_unicode(dk, %(var_name)s, hash);
330
+ }
331
331
 
332
- if (cache_dk_index >= 0) {
333
- assert(dk->dk_kind != DICT_KEYS_SPLIT);
332
+ if (cache_dk_index >= 0) {
333
+ assert(dk->dk_kind != DICT_KEYS_SPLIT);
334
334
 
335
- PyDictUnicodeEntry *entries = DK_UNICODE_ENTRIES(dk);
335
+ PyDictUnicodeEntry *entries = DK_UNICODE_ENTRIES(dk);
336
336
 
337
- result = entries[cache_dk_index].me_value;
337
+ result = entries[cache_dk_index].me_value;
338
338
 
339
- if (unlikely(result == NULL)) {
340
- Py_hash_t hash = ((Nuitka_StringObject *)%(var_name)s)->_base._base.hash;
341
- assert(hash != -1);
339
+ if (unlikely(result == NULL)) {
340
+ Py_hash_t hash = ((Nuitka_StringObject *)%(var_name)s)->_base._base.hash;
341
+ assert(hash != -1);
342
342
 
343
- cache_dk_index = Nuitka_Py_unicodekeys_lookup_unicode(dk, %(var_name)s, hash);
343
+ cache_dk_index = Nuitka_Py_unicodekeys_lookup_unicode(dk, %(var_name)s, hash);
344
344
 
345
- if (cache_dk_index >= 0) {
346
- result = entries[cache_dk_index].me_value;
345
+ if (cache_dk_index >= 0) {
346
+ result = entries[cache_dk_index].me_value;
347
+ }
347
348
  }
349
+ } else {
350
+ result = NULL;
348
351
  }
349
352
  } else {
350
- result = NULL;
353
+ result = GET_STRING_DICT_VALUE(moduledict_%(module_identifier)s, (Nuitka_StringObject *)%(var_name)s);
351
354
  }
352
355
  #endif
353
356
 
@@ -41,8 +41,11 @@ else
41
41
  assert(result_mp != NULL);
42
42
  {{ result }} = (PyObject *)result_mp;
43
43
 
44
+ #if PYTHON_VERSION < 0x3b0
44
45
  Py_ssize_t size = DK_ENTRIES_SIZE(dict_mp->ma_keys);
45
-
46
+ #else
47
+ Py_ssize_t size = dict_mp->ma_keys->dk_nentries + dict_mp->ma_keys->dk_usable;
48
+ #endif
46
49
  {% if per_key_code %}
47
50
  #if PYTHON_VERSION < 0x3b0
48
51
  for (Py_ssize_t i = 0; i < size; i++) {
@@ -137,7 +137,10 @@ print("\\n".join(sorted(
137
137
  "_collections_abc.py",
138
138
  "_collections_abc.pyc",
139
139
  ):
140
- if python_version >= 0x3D0:
140
+ # Note: This was only useful for 3.13.0, and 3.13.1 already
141
+ # didn't need it anymore. So precise version check for a major
142
+ # version is correct here.
143
+ if python_version == 0x3D0:
141
144
  detections.append((module_name, 2, "sourcefile", filename))
142
145
 
143
146
  module_name = ModuleName("_collections_abc")
@@ -27,7 +27,7 @@ from nuitka.Options import (
27
27
  shallMakeModule,
28
28
  )
29
29
  from nuitka.OutputDirectories import getStandaloneDirectoryPath
30
- from nuitka.Tracing import general, options_logger
30
+ from nuitka.Tracing import general, inclusion_logger, options_logger
31
31
  from nuitka.utils.FileOperations import (
32
32
  areSamePaths,
33
33
  containsPathElements,
@@ -336,6 +336,15 @@ def addIncludedDataFile(included_datafile):
336
336
  ):
337
337
  included_datafile.tags.add("external")
338
338
 
339
+ dest_path = getOutputPath(included_datafile.dest_path)
340
+
341
+ if areSamePaths(dest_path, included_datafile.source_path):
342
+ inclusion_logger.sysexit(
343
+ """\
344
+ Error, when asking to copy files external data, you cannot output to\
345
+ same directory and need to use '--output-dir' option."""
346
+ )
347
+
339
348
  _included_data_files.append(included_datafile)
340
349
 
341
350
 
nuitka/freezer/Onefile.py CHANGED
@@ -244,6 +244,7 @@ def packDistFolderToOnefileBootstrap(onefile_output_filename, dist_dir):
244
244
 
245
245
  if isMacOS():
246
246
  addMacOSCodeSignature(filenames=[onefile_output_filename])
247
+ assert payload_used_in_build
247
248
 
248
249
  if not payload_used_in_build:
249
250
  runOnefileCompressor(
@@ -20,7 +20,7 @@ from .NodeMakingHelpers import (
20
20
  makeRaiseTypeErrorExceptionReplacementFromTemplateAndValue,
21
21
  wrapExpressionWithSideEffects,
22
22
  )
23
- from .shapes.StandardShapes import tshape_iterator
23
+ from .shapes.IteratorShapes import tshape_iterator
24
24
  from .StatementBasesGenerated import (
25
25
  StatementSpecialUnpackCheckBase,
26
26
  StatementSpecialUnpackCheckFromIteratedBase,
@@ -61,7 +61,7 @@ from .NodeMakingHelpers import (
61
61
  makeStatementOnlyNodesFromExpressions,
62
62
  wrapExpressionWithSideEffects,
63
63
  )
64
- from .shapes.StandardShapes import tshape_iterator
64
+ from .shapes.IteratorShapes import tshape_iterator
65
65
  from .StatementBasesGenerated import (
66
66
  StatementDictOperationRemoveBase,
67
67
  StatementDictOperationSetBase,
@@ -31,7 +31,8 @@ from .shapes.ControlFlowDescriptions import (
31
31
  ControlFlowDescriptionFullEscape,
32
32
  ControlFlowDescriptionNoEscape,
33
33
  )
34
- from .shapes.StandardShapes import tshape_iterator, tshape_unknown
34
+ from .shapes.IteratorShapes import tshape_iterator
35
+ from .shapes.StandardShapes import tshape_unknown
35
36
  from .StatementBasesGenerated import (
36
37
  StatementAssignmentVariableConstantImmutableBase,
37
38
  StatementAssignmentVariableConstantMutableBase,
@@ -0,0 +1,71 @@
1
+ # Copyright 2024, Kay Hayen, mailto:kay.hayen@gmail.com find license text at end of file
2
+
3
+
4
+ """ Iterator shapes that commonly appear. """
5
+
6
+ from .ControlFlowDescriptions import ControlFlowDescriptionFullEscape
7
+ from .ShapeMixins import ShapeIteratorMixin
8
+ from .StandardShapes import ShapeBase, tshape_unknown
9
+
10
+
11
+ class ShapeIterator(ShapeBase, ShapeIteratorMixin):
12
+ """Iterator created by iter with 2 arguments, TODO: could be way more specific."""
13
+
14
+ __slots__ = ()
15
+
16
+ @staticmethod
17
+ def isShapeIterator():
18
+ return None
19
+
20
+ @staticmethod
21
+ def hasShapeSlotBool():
22
+ return None
23
+
24
+ @staticmethod
25
+ def hasShapeSlotLen():
26
+ return None
27
+
28
+ @staticmethod
29
+ def hasShapeSlotInt():
30
+ return None
31
+
32
+ @staticmethod
33
+ def hasShapeSlotLong():
34
+ return None
35
+
36
+ @staticmethod
37
+ def hasShapeSlotFloat():
38
+ return None
39
+
40
+ @staticmethod
41
+ def getShapeIter():
42
+ return tshape_iterator
43
+
44
+ @staticmethod
45
+ def getOperationUnaryReprEscape():
46
+ return ControlFlowDescriptionFullEscape
47
+
48
+ def getOperationUnaryAddShape(self):
49
+ # TODO: Move prepared values to separate module
50
+ return tshape_unknown, ControlFlowDescriptionFullEscape
51
+
52
+ def getOperationUnarySubShape(self):
53
+ return tshape_unknown, ControlFlowDescriptionFullEscape
54
+
55
+
56
+ tshape_iterator = ShapeIterator()
57
+
58
+ # Part of "Nuitka", an optimizing Python compiler that is compatible and
59
+ # integrates with CPython, but also works on its own.
60
+ #
61
+ # Licensed under the Apache License, Version 2.0 (the "License");
62
+ # you may not use this file except in compliance with the License.
63
+ # You may obtain a copy of the License at
64
+ #
65
+ # http://www.apache.org/licenses/LICENSE-2.0
66
+ #
67
+ # Unless required by applicable law or agreed to in writing, software
68
+ # distributed under the License is distributed on an "AS IS" BASIS,
69
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
70
+ # See the License for the specific language governing permissions and
71
+ # limitations under the License.
@@ -11,6 +11,7 @@ from .ControlFlowDescriptions import (
11
11
  ControlFlowDescriptionNoEscape,
12
12
  ControlFlowDescriptionSubUnsupported,
13
13
  )
14
+ from .StandardShapes import tshape_unknown
14
15
 
15
16
 
16
17
  class ShapeContainerMixin(object):
@@ -140,11 +141,11 @@ class ShapeNotNumberMixin(object):
140
141
 
141
142
  @staticmethod
142
143
  def getOperationUnaryAddShape():
143
- return None, ControlFlowDescriptionAddUnsupported
144
+ return tshape_unknown, ControlFlowDescriptionAddUnsupported
144
145
 
145
146
  @staticmethod
146
147
  def getOperationUnarySubShape():
147
- return None, ControlFlowDescriptionSubUnsupported
148
+ return tshape_unknown, ControlFlowDescriptionSubUnsupported
148
149
 
149
150
 
150
151
  class ShapeNumberMixin(object):
@@ -15,7 +15,6 @@ from nuitka.code_generation.Reports import (
15
15
  from nuitka.utils.SlotMetaClasses import getMetaClassBase
16
16
 
17
17
  from .ControlFlowDescriptions import ControlFlowDescriptionFullEscape
18
- from .ShapeMixins import ShapeIteratorMixin
19
18
 
20
19
 
21
20
  class ShapeBase(getMetaClassBase("Shape", require_slots=True)):
@@ -130,7 +129,7 @@ class ShapeBase(getMetaClassBase("Shape", require_slots=True)):
130
129
  return operation_result_unknown
131
130
 
132
131
  # TODO: Change defaults to be "None" for easier catching of
133
- # non-overloaders
132
+ # non-overloading cases.
134
133
  iadd_shapes = {}
135
134
 
136
135
  def getOperationInplaceAddShape(self, right_shape):
@@ -632,54 +631,6 @@ class ShapeLargeConstantValuePredictable(ShapeLargeConstantValue):
632
631
  self.predictor = predictor
633
632
 
634
633
 
635
- class ShapeIterator(ShapeBase, ShapeIteratorMixin):
636
- """Iterator created by iter with 2 arguments, TODO: could be way more specific."""
637
-
638
- __slots__ = ()
639
-
640
- @staticmethod
641
- def isShapeIterator():
642
- return None
643
-
644
- @staticmethod
645
- def hasShapeSlotBool():
646
- return None
647
-
648
- @staticmethod
649
- def hasShapeSlotLen():
650
- return None
651
-
652
- @staticmethod
653
- def hasShapeSlotInt():
654
- return None
655
-
656
- @staticmethod
657
- def hasShapeSlotLong():
658
- return None
659
-
660
- @staticmethod
661
- def hasShapeSlotFloat():
662
- return None
663
-
664
- @staticmethod
665
- def getShapeIter():
666
- return tshape_iterator
667
-
668
- @staticmethod
669
- def getOperationUnaryReprEscape():
670
- return ControlFlowDescriptionFullEscape
671
-
672
- def getOperationUnaryAddShape(self):
673
- # TODO: Move prepared values to separate module
674
- return tshape_unknown, ControlFlowDescriptionFullEscape
675
-
676
- def getOperationUnarySubShape(self):
677
- return tshape_unknown, ControlFlowDescriptionFullEscape
678
-
679
-
680
- tshape_iterator = ShapeIterator()
681
-
682
-
683
634
  class ShapeLoopInitialAlternative(ShapeBase):
684
635
  """Merge of loop wrap around with loop start value.
685
636