Nuitka-winsvc 2.2.3__cp311-cp311-win_amd64.whl → 2.3__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.
Files changed (198) hide show
  1. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/METADATA +1 -1
  2. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/RECORD +198 -197
  3. nuitka/Bytecodes.py +4 -2
  4. nuitka/HardImportRegistry.py +1 -0
  5. nuitka/MainControl.py +16 -10
  6. nuitka/ModuleRegistry.py +15 -0
  7. nuitka/OptionParsing.py +30 -8
  8. nuitka/Options.py +104 -44
  9. nuitka/PostProcessing.py +9 -8
  10. nuitka/PythonVersions.py +2 -1
  11. nuitka/Serialization.py +47 -30
  12. nuitka/Version.py +1 -1
  13. nuitka/build/Backend.scons +46 -19
  14. nuitka/build/CCompilerVersion.scons +3 -3
  15. nuitka/build/Onefile.scons +4 -4
  16. nuitka/build/SconsCaching.py +3 -2
  17. nuitka/build/SconsCompilerSettings.py +11 -5
  18. nuitka/build/SconsInterface.py +22 -6
  19. nuitka/build/SconsUtils.py +9 -1
  20. nuitka/build/include/nuitka/allocator.h +58 -2
  21. nuitka/build/include/nuitka/compiled_frame.h +48 -13
  22. nuitka/build/include/nuitka/compiled_function.h +4 -0
  23. nuitka/build/include/nuitka/constants.h +6 -0
  24. nuitka/build/include/nuitka/exception_groups.h +6 -6
  25. nuitka/build/include/nuitka/exceptions.h +3 -3
  26. nuitka/build/include/nuitka/freelists.h +11 -0
  27. nuitka/build/include/nuitka/helper/dictionaries.h +5 -4
  28. nuitka/build/include/nuitka/helper/lists.h +5 -5
  29. nuitka/build/include/nuitka/helper/lists_generated.h +12 -12
  30. nuitka/build/include/nuitka/helper/sequences.h +6 -0
  31. nuitka/build/include/nuitka/helper/slices.h +14 -8
  32. nuitka/build/include/nuitka/helper/subscripts.h +1 -184
  33. nuitka/build/include/nuitka/helper/tuples.h +42 -33
  34. nuitka/build/include/nuitka/importing.h +5 -0
  35. nuitka/build/include/nuitka/prelude.h +35 -2
  36. nuitka/build/include/nuitka/safe_string_ops.h +1 -0
  37. nuitka/build/include/nuitka/threading.h +13 -10
  38. nuitka/build/static_src/CompiledAsyncgenType.c +19 -8
  39. nuitka/build/static_src/CompiledCellType.c +1 -1
  40. nuitka/build/static_src/CompiledCodeHelpers.c +18 -16
  41. nuitka/build/static_src/CompiledCoroutineType.c +23 -19
  42. nuitka/build/static_src/CompiledFrameType.c +46 -34
  43. nuitka/build/static_src/CompiledFunctionType.c +55 -34
  44. nuitka/build/static_src/CompiledGeneratorType.c +21 -19
  45. nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +127 -130
  46. nuitka/build/static_src/CompiledMethodType.c +15 -17
  47. nuitka/build/static_src/HelpersAllocator.c +71 -0
  48. nuitka/build/static_src/HelpersAttributes.c +1 -1
  49. nuitka/build/static_src/HelpersBuiltin.c +5 -5
  50. nuitka/build/static_src/HelpersBytes.c +2 -2
  51. nuitka/build/static_src/HelpersCalling.c +3 -0
  52. nuitka/build/static_src/HelpersCallingGenerated.c +131 -131
  53. nuitka/build/static_src/HelpersComparisonEq.c +329 -329
  54. nuitka/build/static_src/HelpersComparisonEqUtils.c +3 -1
  55. nuitka/build/static_src/HelpersComparisonGe.c +322 -322
  56. nuitka/build/static_src/HelpersComparisonGt.c +321 -321
  57. nuitka/build/static_src/HelpersComparisonLe.c +322 -322
  58. nuitka/build/static_src/HelpersComparisonLt.c +321 -321
  59. nuitka/build/static_src/HelpersComparisonNe.c +329 -329
  60. nuitka/build/static_src/HelpersConsole.c +96 -0
  61. nuitka/build/static_src/HelpersConstantsBlob.c +10 -6
  62. nuitka/build/static_src/HelpersDeepcopy.c +10 -8
  63. nuitka/build/static_src/HelpersDictionaries.c +17 -11
  64. nuitka/build/static_src/HelpersDictionariesGenerated.c +65 -29
  65. nuitka/build/static_src/HelpersExceptions.c +107 -9
  66. nuitka/build/static_src/HelpersFilesystemPaths.c +64 -4
  67. nuitka/build/static_src/HelpersFloats.c +20 -14
  68. nuitka/build/static_src/HelpersImport.c +1 -1
  69. nuitka/build/static_src/HelpersJitSources.c +1 -1
  70. nuitka/build/static_src/HelpersLists.c +29 -19
  71. nuitka/build/static_src/HelpersListsGenerated.c +24 -24
  72. nuitka/build/static_src/HelpersMatching.c +32 -5
  73. nuitka/build/static_src/HelpersOperationBinaryAdd.c +90 -63
  74. nuitka/build/static_src/HelpersOperationBinaryAddUtils.c +4 -4
  75. nuitka/build/static_src/HelpersOperationBinaryBitand.c +33 -33
  76. nuitka/build/static_src/HelpersOperationBinaryBitor.c +33 -33
  77. nuitka/build/static_src/HelpersOperationBinaryBitxor.c +33 -33
  78. nuitka/build/static_src/HelpersOperationBinaryDivmod.c +24 -24
  79. nuitka/build/static_src/HelpersOperationBinaryFloordiv.c +24 -24
  80. nuitka/build/static_src/HelpersOperationBinaryLshift.c +30 -30
  81. nuitka/build/static_src/HelpersOperationBinaryMatmult.c +7 -7
  82. nuitka/build/static_src/HelpersOperationBinaryMod.c +90 -90
  83. nuitka/build/static_src/HelpersOperationBinaryMult.c +64 -58
  84. nuitka/build/static_src/HelpersOperationBinaryOlddiv.c +24 -24
  85. nuitka/build/static_src/HelpersOperationBinaryPow.c +27 -27
  86. nuitka/build/static_src/HelpersOperationBinaryRshift.c +30 -30
  87. nuitka/build/static_src/HelpersOperationBinarySub.c +24 -24
  88. nuitka/build/static_src/HelpersOperationBinaryTruediv.c +24 -24
  89. nuitka/build/static_src/HelpersOperationInplaceAdd.c +67 -49
  90. nuitka/build/static_src/HelpersOperationInplaceBitand.c +25 -25
  91. nuitka/build/static_src/HelpersOperationInplaceBitor.c +25 -25
  92. nuitka/build/static_src/HelpersOperationInplaceBitxor.c +25 -25
  93. nuitka/build/static_src/HelpersOperationInplaceFloordiv.c +28 -28
  94. nuitka/build/static_src/HelpersOperationInplaceLshift.c +18 -18
  95. nuitka/build/static_src/HelpersOperationInplaceMatmult.c +10 -10
  96. nuitka/build/static_src/HelpersOperationInplaceMod.c +70 -70
  97. nuitka/build/static_src/HelpersOperationInplaceMult.c +33 -33
  98. nuitka/build/static_src/HelpersOperationInplaceOlddiv.c +28 -28
  99. nuitka/build/static_src/HelpersOperationInplacePow.c +28 -28
  100. nuitka/build/static_src/HelpersOperationInplaceRshift.c +18 -18
  101. nuitka/build/static_src/HelpersOperationInplaceSub.c +28 -28
  102. nuitka/build/static_src/HelpersOperationInplaceTruediv.c +28 -28
  103. nuitka/build/static_src/HelpersRaising.c +10 -3
  104. nuitka/build/static_src/HelpersSafeStrings.c +14 -4
  105. nuitka/build/static_src/HelpersSlices.c +12 -5
  106. nuitka/build/static_src/HelpersStrings.c +1 -1
  107. nuitka/build/static_src/HelpersTuples.c +20 -15
  108. nuitka/build/static_src/InspectPatcher.c +74 -6
  109. nuitka/build/static_src/MainProgram.c +90 -25
  110. nuitka/build/static_src/MetaPathBasedLoader.c +81 -45
  111. nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +2 -2
  112. nuitka/build/static_src/OnefileBootstrap.c +16 -17
  113. nuitka/code_generation/CodeGeneration.py +5 -2
  114. nuitka/code_generation/ConstantCodes.py +2 -2
  115. nuitka/code_generation/DictCodes.py +2 -2
  116. nuitka/code_generation/GlobalConstants.py +5 -0
  117. nuitka/code_generation/GlobalsLocalsCodes.py +2 -2
  118. nuitka/code_generation/ListCodes.py +2 -2
  119. nuitka/code_generation/LocalsDictCodes.py +1 -1
  120. nuitka/code_generation/ModuleCodes.py +19 -0
  121. nuitka/code_generation/PackageResourceCodes.py +14 -0
  122. nuitka/code_generation/SliceCodes.py +3 -3
  123. nuitka/code_generation/SubscriptCodes.py +5 -13
  124. nuitka/code_generation/TupleCodes.py +1 -1
  125. nuitka/code_generation/c_types/CTypePyObjectPointers.py +7 -7
  126. nuitka/code_generation/templates/CodeTemplatesConstants.py +7 -5
  127. nuitka/code_generation/templates/CodeTemplatesLoader.py +2 -0
  128. nuitka/code_generation/templates/CodeTemplatesModules.py +78 -54
  129. nuitka/code_generation/templates_c/CodeTemplateCallsMixed.c.j2 +1 -1
  130. nuitka/code_generation/templates_c/CodeTemplateCallsPositional.c.j2 +8 -8
  131. nuitka/code_generation/templates_c/CodeTemplateCallsPositionalMethodDescr.c.j2 +5 -5
  132. nuitka/code_generation/templates_c/CodeTemplateMakeListHinted.c.j2 +2 -2
  133. nuitka/code_generation/templates_c/CodeTemplateMakeListSmall.c.j2 +2 -2
  134. nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +57 -21
  135. nuitka/code_generation/templates_c/HelperImportHard.c.j2 +1 -1
  136. nuitka/code_generation/templates_c/HelperOperationBinary.c.j2 +5 -5
  137. nuitka/code_generation/templates_c/HelperOperationComparison.c.j2 +18 -18
  138. nuitka/code_generation/templates_c/HelperOperationComparisonBytes.c.j2 +11 -11
  139. nuitka/code_generation/templates_c/HelperOperationComparisonFloat.c.j2 +3 -3
  140. nuitka/code_generation/templates_c/HelperOperationComparisonInt.c.j2 +3 -3
  141. nuitka/code_generation/templates_c/HelperOperationComparisonList.c.j2 +7 -7
  142. nuitka/code_generation/templates_c/HelperOperationComparisonLong.c.j2 +3 -3
  143. nuitka/code_generation/templates_c/HelperOperationComparisonStr.c.j2 +11 -11
  144. nuitka/code_generation/templates_c/HelperOperationComparisonTuple.c.j2 +7 -7
  145. nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +10 -10
  146. nuitka/code_generation/templates_c/HelperOperationInplace.c.j2 +1 -1
  147. nuitka/code_generation/templates_c/HelperSlotsBinary.c.j2 +3 -3
  148. nuitka/code_generation/templates_c/HelperSlotsList.c.j2 +4 -1
  149. nuitka/code_generation/templates_c/HelperSlotsTuple.c.j2 +4 -1
  150. nuitka/finalizations/FinalizeMarkups.py +0 -18
  151. nuitka/freezer/DependsExe.py +9 -4
  152. nuitka/freezer/DllDependenciesMacOS.py +1 -1
  153. nuitka/freezer/DllDependenciesWin32.py +1 -1
  154. nuitka/freezer/ImportDetection.py +1 -0
  155. nuitka/freezer/IncludedDataFiles.py +13 -4
  156. nuitka/freezer/Onefile.py +0 -1
  157. nuitka/freezer/Standalone.py +3 -1
  158. nuitka/importing/ImportCache.py +3 -2
  159. nuitka/importing/Importing.py +16 -3
  160. nuitka/importing/StandardLibrary.py +4 -0
  161. nuitka/nodes/ChildrenHavingMixins.py +2 -0
  162. nuitka/nodes/ExpressionBasesGenerated.py +4 -0
  163. nuitka/nodes/HardImportNodesGenerated.py +83 -0
  164. nuitka/nodes/ModuleNodes.py +10 -2
  165. nuitka/nodes/OsSysNodes.py +16 -0
  166. nuitka/nodes/SubscriptNodes.py +3 -3
  167. nuitka/plugins/PluginBase.py +2 -0
  168. nuitka/plugins/standard/DataFilesPlugin.py +22 -1
  169. nuitka/plugins/standard/DillPlugin/DillPlugin.c +3 -3
  170. nuitka/plugins/standard/OptionsNannyPlugin.py +9 -41
  171. nuitka/plugins/standard/PkgResourcesPlugin.py +8 -2
  172. nuitka/plugins/standard/PySidePyQtPlugin.py +3 -0
  173. nuitka/plugins/standard/standard.nuitka-package.config.yml +18 -12
  174. nuitka/plugins/standard/stdlib2.nuitka-package.config.yml +2 -2
  175. nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +2 -2
  176. nuitka/specs/HardImportSpecs.py +3 -0
  177. nuitka/specs/ParameterSpecs.py +26 -15
  178. nuitka/tools/general/find_module/FindModuleCode.py +3 -2
  179. nuitka/tools/specialize/CTypeDescriptions.py +11 -9
  180. nuitka/tools/testing/Common.py +12 -5
  181. nuitka/tools/testing/SearchModes.py +5 -1
  182. nuitka/tools/watch/GitHub.py +1 -7
  183. nuitka/tree/Building.py +9 -6
  184. nuitka/tree/ReformulationMatchStatements.py +39 -3
  185. nuitka/tree/TreeHelpers.py +8 -0
  186. nuitka/utils/CStrings.py +7 -0
  187. nuitka/utils/Execution.py +10 -1
  188. nuitka/utils/FileOperations.py +21 -13
  189. nuitka/utils/Importing.py +24 -0
  190. nuitka/utils/ReExecute.py +7 -3
  191. nuitka/utils/SharedLibraries.py +17 -0
  192. nuitka/utils/Yaml.py +9 -1
  193. {Nuitka_winsvc-2.2.3.data → Nuitka_winsvc-2.3.data}/scripts/nuitka-run.bat +0 -0
  194. {Nuitka_winsvc-2.2.3.data → Nuitka_winsvc-2.3.data}/scripts/nuitka.bat +0 -0
  195. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/LICENSE.txt +0 -0
  196. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/WHEEL +0 -0
  197. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/entry_points.txt +0 -0
  198. {Nuitka_winsvc-2.2.3.dist-info → Nuitka_winsvc-2.3.dist-info}/top_level.txt +0 -0
nuitka/utils/CStrings.py CHANGED
@@ -63,16 +63,23 @@ def encodePythonUnicodeToC(value):
63
63
  assert type(value) is unicode, type(value)
64
64
 
65
65
  result = ""
66
+ last_was_hex = False
66
67
 
67
68
  for c in value:
68
69
  cv = ord(c)
69
70
 
70
71
  if c == "\\":
71
72
  result += "\\\\"
73
+ last_was_hex = False
72
74
  elif 34 < cv < 128:
75
+ if last_was_hex:
76
+ result += '" L"'
77
+
73
78
  result += c
79
+ last_was_hex = False
74
80
  else:
75
81
  result += r"\x%04x" % cv
82
+ last_was_hex = True
76
83
 
77
84
  return 'L"%s"' % result
78
85
 
nuitka/utils/Execution.py CHANGED
@@ -421,8 +421,17 @@ def createProcess(
421
421
 
422
422
 
423
423
  def executeProcess(
424
- command, env=None, stdin=False, shell=False, external_cwd=False, timeout=None
424
+ command,
425
+ env=None,
426
+ stdin=False,
427
+ shell=False,
428
+ external_cwd=False,
429
+ timeout=None,
430
+ logger=None,
425
431
  ):
432
+ if logger is not None:
433
+ logger.info("Executing command '%s'." % " ".join(command), keep_format=True)
434
+
426
435
  process = createProcess(
427
436
  command=command, env=env, stdin=stdin, shell=shell, external_cwd=external_cwd
428
437
  )
@@ -730,23 +730,31 @@ def removeDirectory(path, ignore_errors):
730
730
  """
731
731
 
732
732
  def onError(func, path, exc_info):
733
- # Try again immediately, ignore what happened, pylint: disable=unused-argument
734
- try:
735
- func(path)
736
- except OSError:
737
- time.sleep(0.1)
738
-
739
- func(path)
733
+ # Record what happened what happened, pylint: disable=unused-argument
734
+ last_error.append(func, path)
740
735
 
741
736
  with withFileLock("removing directory %s" % path):
742
737
  if os.path.exists(path):
743
- try:
738
+ previous_error = []
739
+
740
+ while True:
741
+ last_error = []
744
742
  shutil.rmtree(path, ignore_errors=False, onerror=onError)
745
- except OSError:
746
- if ignore_errors:
743
+
744
+ # onError as a side effect, modifies last_error
745
+ if previous_error == last_error:
746
+ break
747
+
748
+ previous_error = list(last_error)
749
+ time.sleep(0.1)
750
+
751
+ # if it still exists, try one more time, this time not ignoring errors.
752
+ if os.path.exists(path):
753
+ try:
747
754
  shutil.rmtree(path, ignore_errors=ignore_errors)
748
- else:
749
- raise
755
+ except OSError:
756
+ if not ignore_errors:
757
+ raise
750
758
 
751
759
 
752
760
  def resetDirectory(path, ignore_errors):
@@ -1438,7 +1446,7 @@ def syncFileOutput(file_handle):
1438
1446
 
1439
1447
  def isFilesystemEncodable(filename):
1440
1448
  """Decide if a filename is safe for use as a file system path with tools."""
1441
- if os.name == "nt":
1449
+ if os.name == "nt" and type(filename) is unicode:
1442
1450
  value = (
1443
1451
  unicodedata.normalize("NFKD", filename)
1444
1452
  .encode("ascii", "ignore")
nuitka/utils/Importing.py CHANGED
@@ -307,6 +307,30 @@ def getModuleNameAndKindFromFilenameSuffix(module_filename):
307
307
  return None, None
308
308
 
309
309
 
310
+ def hasPackageDirFilename(path):
311
+ path = os.path.basename(path)
312
+
313
+ for suffix in (".py",) + getSharedLibrarySuffixes():
314
+ candidate = "__init__" + suffix
315
+
316
+ if candidate == path:
317
+ return True
318
+
319
+ return False
320
+
321
+
322
+ def getPackageDirFilename(path):
323
+ assert os.path.isdir(path)
324
+
325
+ for suffix in (".py",) + getSharedLibrarySuffixes():
326
+ candidate = os.path.join(path, "__init__" + suffix)
327
+
328
+ if os.path.isfile(candidate):
329
+ return candidate
330
+
331
+ return None
332
+
333
+
310
334
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
311
335
  # integrates with CPython, but also works on its own.
312
336
  #
nuitka/utils/ReExecute.py CHANGED
@@ -13,7 +13,7 @@ import os
13
13
  import sys
14
14
 
15
15
 
16
- def callExecProcess(args):
16
+ def callExecProcess(args, uac):
17
17
  """Do exec in a portable way preserving exit code.
18
18
 
19
19
  On Windows, unfortunately there is no real exec, so we have to spawn
@@ -33,7 +33,7 @@ def callExecProcess(args):
33
33
 
34
34
  try:
35
35
  # Context manager is not available on all Python versions, pylint: disable=consider-using-with
36
- process = subprocess.Popen(args=args)
36
+ process = subprocess.Popen(args=args, shell=uac)
37
37
  process.communicate()
38
38
  # No point in cleaning up, just exit the hard way.
39
39
  try:
@@ -46,6 +46,10 @@ def callExecProcess(args):
46
46
  # There was a more relevant stack trace already, so abort this
47
47
  # right here.
48
48
  os._exit(2)
49
+ except OSError as e:
50
+ print("Error, executing: %s" % e)
51
+ os._exit(2)
52
+
49
53
  else:
50
54
  # The star arguments is the API of execl
51
55
  os.execl(*args)
@@ -120,7 +124,7 @@ def reExecuteNuitka(pgo_filename):
120
124
  os.environ["NUITKA_REEXECUTION"] = "1"
121
125
 
122
126
  # Does not return:
123
- callExecProcess(args)
127
+ callExecProcess(args, uac=False)
124
128
 
125
129
 
126
130
  # Part of "Nuitka", an optimizing Python compiler that is compatible and
@@ -364,6 +364,23 @@ Error, needs 'patchelf' on your system, to modify 'RPATH' settings that \
364
364
  need to be updated."""
365
365
 
366
366
 
367
+ def checkPatchElfPresenceAndUsability(logger):
368
+ """Checks if patchelf is present and usable."""
369
+
370
+ output = executeToolChecked(
371
+ logger=logger,
372
+ command=("patchelf", "--version"),
373
+ absence_message="""\
374
+ Error, standalone mode on Linux requires 'patchelf' to be \
375
+ installed. Use 'apt/dnf/yum install patchelf' first.""",
376
+ )
377
+
378
+ if output.split() == b"0.18.0":
379
+ logger.sysexit(
380
+ "Error, patchelf version 0.18.0 is a known buggy release and cannot be used. Please upgrade or downgrade it."
381
+ )
382
+
383
+
367
384
  def _setSharedLibraryRPATHElf(filename, rpath):
368
385
  # patchelf --set-rpath "$ORIGIN/path/to/library" <executable>
369
386
  with withEnvironmentVarOverridden("LANG", "C"):
nuitka/utils/Yaml.py CHANGED
@@ -38,7 +38,15 @@ class PackageConfigYaml(object):
38
38
 
39
39
  assert type(file_data) is bytes
40
40
  data = parseYaml(file_data)
41
- assert type(data) is list
41
+
42
+ if not data:
43
+ general.sysexit(
44
+ """\
45
+ Error, empty (or malformed?) user package configuration '%s' used."""
46
+ % name
47
+ )
48
+
49
+ assert type(data) is list, type(data)
42
50
 
43
51
  self.data = OrderedDict()
44
52