@djlint/linux-s390x-gnu 0.0.0-stage → 1.54.0

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 (1598) hide show
  1. package/LICENSE +675 -0
  2. package/README.md +4 -2
  3. package/package.json +23 -4
  4. package/python/bin/python3 +0 -0
  5. package/python/lib/python3.14/LICENSE.txt +277 -0
  6. package/python/lib/python3.14/__future__.py +147 -0
  7. package/python/lib/python3.14/__hello__.py +16 -0
  8. package/python/lib/python3.14/__phello__/__init__.py +7 -0
  9. package/python/lib/python3.14/__phello__/__pycache__/__init__.cpython-314.pyc +0 -0
  10. package/python/lib/python3.14/__phello__/__pycache__/spam.cpython-314.pyc +0 -0
  11. package/python/lib/python3.14/__phello__/spam.py +7 -0
  12. package/python/lib/python3.14/__pycache__/__future__.cpython-314.pyc +0 -0
  13. package/python/lib/python3.14/__pycache__/__hello__.cpython-314.pyc +0 -0
  14. package/python/lib/python3.14/__pycache__/_aix_support.cpython-314.pyc +0 -0
  15. package/python/lib/python3.14/__pycache__/_android_support.cpython-314.pyc +0 -0
  16. package/python/lib/python3.14/__pycache__/_apple_support.cpython-314.pyc +0 -0
  17. package/python/lib/python3.14/__pycache__/_ast_unparse.cpython-314.pyc +0 -0
  18. package/python/lib/python3.14/__pycache__/_collections_abc.cpython-314.pyc +0 -0
  19. package/python/lib/python3.14/__pycache__/_colorize.cpython-314.pyc +0 -0
  20. package/python/lib/python3.14/__pycache__/_compat_pickle.cpython-314.pyc +0 -0
  21. package/python/lib/python3.14/__pycache__/_ios_support.cpython-314.pyc +0 -0
  22. package/python/lib/python3.14/__pycache__/_markupbase.cpython-314.pyc +0 -0
  23. package/python/lib/python3.14/__pycache__/_opcode_metadata.cpython-314.pyc +0 -0
  24. package/python/lib/python3.14/__pycache__/_osx_support.cpython-314.pyc +0 -0
  25. package/python/lib/python3.14/__pycache__/_py_abc.cpython-314.pyc +0 -0
  26. package/python/lib/python3.14/__pycache__/_py_warnings.cpython-314.pyc +0 -0
  27. package/python/lib/python3.14/__pycache__/_pydatetime.cpython-314.pyc +0 -0
  28. package/python/lib/python3.14/__pycache__/_pydecimal.cpython-314.pyc +0 -0
  29. package/python/lib/python3.14/__pycache__/_pyio.cpython-314.pyc +0 -0
  30. package/python/lib/python3.14/__pycache__/_pylong.cpython-314.pyc +0 -0
  31. package/python/lib/python3.14/__pycache__/_sitebuiltins.cpython-314.pyc +0 -0
  32. package/python/lib/python3.14/__pycache__/_strptime.cpython-314.pyc +0 -0
  33. package/python/lib/python3.14/__pycache__/_sysconfigdata__linux_s390x-linux-gnu.cpython-314.pyc +0 -0
  34. package/python/lib/python3.14/__pycache__/_threading_local.cpython-314.pyc +0 -0
  35. package/python/lib/python3.14/__pycache__/_weakrefset.cpython-314.pyc +0 -0
  36. package/python/lib/python3.14/__pycache__/abc.cpython-314.pyc +0 -0
  37. package/python/lib/python3.14/__pycache__/annotationlib.cpython-314.pyc +0 -0
  38. package/python/lib/python3.14/__pycache__/antigravity.cpython-314.pyc +0 -0
  39. package/python/lib/python3.14/__pycache__/argparse.cpython-314.pyc +0 -0
  40. package/python/lib/python3.14/__pycache__/ast.cpython-314.pyc +0 -0
  41. package/python/lib/python3.14/__pycache__/base64.cpython-314.pyc +0 -0
  42. package/python/lib/python3.14/__pycache__/bdb.cpython-314.pyc +0 -0
  43. package/python/lib/python3.14/__pycache__/bisect.cpython-314.pyc +0 -0
  44. package/python/lib/python3.14/__pycache__/bz2.cpython-314.pyc +0 -0
  45. package/python/lib/python3.14/__pycache__/cProfile.cpython-314.pyc +0 -0
  46. package/python/lib/python3.14/__pycache__/calendar.cpython-314.pyc +0 -0
  47. package/python/lib/python3.14/__pycache__/cmd.cpython-314.pyc +0 -0
  48. package/python/lib/python3.14/__pycache__/code.cpython-314.pyc +0 -0
  49. package/python/lib/python3.14/__pycache__/codecs.cpython-314.pyc +0 -0
  50. package/python/lib/python3.14/__pycache__/codeop.cpython-314.pyc +0 -0
  51. package/python/lib/python3.14/__pycache__/colorsys.cpython-314.pyc +0 -0
  52. package/python/lib/python3.14/__pycache__/compileall.cpython-314.pyc +0 -0
  53. package/python/lib/python3.14/__pycache__/configparser.cpython-314.pyc +0 -0
  54. package/python/lib/python3.14/__pycache__/contextlib.cpython-314.pyc +0 -0
  55. package/python/lib/python3.14/__pycache__/contextvars.cpython-314.pyc +0 -0
  56. package/python/lib/python3.14/__pycache__/copy.cpython-314.pyc +0 -0
  57. package/python/lib/python3.14/__pycache__/copyreg.cpython-314.pyc +0 -0
  58. package/python/lib/python3.14/__pycache__/csv.cpython-314.pyc +0 -0
  59. package/python/lib/python3.14/__pycache__/dataclasses.cpython-314.pyc +0 -0
  60. package/python/lib/python3.14/__pycache__/datetime.cpython-314.pyc +0 -0
  61. package/python/lib/python3.14/__pycache__/decimal.cpython-314.pyc +0 -0
  62. package/python/lib/python3.14/__pycache__/difflib.cpython-314.pyc +0 -0
  63. package/python/lib/python3.14/__pycache__/dis.cpython-314.pyc +0 -0
  64. package/python/lib/python3.14/__pycache__/doctest.cpython-314.pyc +0 -0
  65. package/python/lib/python3.14/__pycache__/enum.cpython-314.pyc +0 -0
  66. package/python/lib/python3.14/__pycache__/filecmp.cpython-314.pyc +0 -0
  67. package/python/lib/python3.14/__pycache__/fileinput.cpython-314.pyc +0 -0
  68. package/python/lib/python3.14/__pycache__/fnmatch.cpython-314.pyc +0 -0
  69. package/python/lib/python3.14/__pycache__/fractions.cpython-314.pyc +0 -0
  70. package/python/lib/python3.14/__pycache__/ftplib.cpython-314.pyc +0 -0
  71. package/python/lib/python3.14/__pycache__/functools.cpython-314.pyc +0 -0
  72. package/python/lib/python3.14/__pycache__/genericpath.cpython-314.pyc +0 -0
  73. package/python/lib/python3.14/__pycache__/getopt.cpython-314.pyc +0 -0
  74. package/python/lib/python3.14/__pycache__/getpass.cpython-314.pyc +0 -0
  75. package/python/lib/python3.14/__pycache__/gettext.cpython-314.pyc +0 -0
  76. package/python/lib/python3.14/__pycache__/glob.cpython-314.pyc +0 -0
  77. package/python/lib/python3.14/__pycache__/graphlib.cpython-314.pyc +0 -0
  78. package/python/lib/python3.14/__pycache__/gzip.cpython-314.pyc +0 -0
  79. package/python/lib/python3.14/__pycache__/hashlib.cpython-314.pyc +0 -0
  80. package/python/lib/python3.14/__pycache__/heapq.cpython-314.pyc +0 -0
  81. package/python/lib/python3.14/__pycache__/hmac.cpython-314.pyc +0 -0
  82. package/python/lib/python3.14/__pycache__/imaplib.cpython-314.pyc +0 -0
  83. package/python/lib/python3.14/__pycache__/inspect.cpython-314.pyc +0 -0
  84. package/python/lib/python3.14/__pycache__/io.cpython-314.pyc +0 -0
  85. package/python/lib/python3.14/__pycache__/ipaddress.cpython-314.pyc +0 -0
  86. package/python/lib/python3.14/__pycache__/keyword.cpython-314.pyc +0 -0
  87. package/python/lib/python3.14/__pycache__/linecache.cpython-314.pyc +0 -0
  88. package/python/lib/python3.14/__pycache__/locale.cpython-314.pyc +0 -0
  89. package/python/lib/python3.14/__pycache__/lzma.cpython-314.pyc +0 -0
  90. package/python/lib/python3.14/__pycache__/mailbox.cpython-314.pyc +0 -0
  91. package/python/lib/python3.14/__pycache__/mimetypes.cpython-314.pyc +0 -0
  92. package/python/lib/python3.14/__pycache__/modulefinder.cpython-314.pyc +0 -0
  93. package/python/lib/python3.14/__pycache__/netrc.cpython-314.pyc +0 -0
  94. package/python/lib/python3.14/__pycache__/ntpath.cpython-314.pyc +0 -0
  95. package/python/lib/python3.14/__pycache__/nturl2path.cpython-314.pyc +0 -0
  96. package/python/lib/python3.14/__pycache__/numbers.cpython-314.pyc +0 -0
  97. package/python/lib/python3.14/__pycache__/opcode.cpython-314.pyc +0 -0
  98. package/python/lib/python3.14/__pycache__/operator.cpython-314.pyc +0 -0
  99. package/python/lib/python3.14/__pycache__/optparse.cpython-314.pyc +0 -0
  100. package/python/lib/python3.14/__pycache__/os.cpython-314.pyc +0 -0
  101. package/python/lib/python3.14/__pycache__/pdb.cpython-314.pyc +0 -0
  102. package/python/lib/python3.14/__pycache__/pickle.cpython-314.pyc +0 -0
  103. package/python/lib/python3.14/__pycache__/pickletools.cpython-314.pyc +0 -0
  104. package/python/lib/python3.14/__pycache__/pkgutil.cpython-314.pyc +0 -0
  105. package/python/lib/python3.14/__pycache__/platform.cpython-314.pyc +0 -0
  106. package/python/lib/python3.14/__pycache__/plistlib.cpython-314.pyc +0 -0
  107. package/python/lib/python3.14/__pycache__/poplib.cpython-314.pyc +0 -0
  108. package/python/lib/python3.14/__pycache__/posixpath.cpython-314.pyc +0 -0
  109. package/python/lib/python3.14/__pycache__/pprint.cpython-314.pyc +0 -0
  110. package/python/lib/python3.14/__pycache__/profile.cpython-314.pyc +0 -0
  111. package/python/lib/python3.14/__pycache__/pstats.cpython-314.pyc +0 -0
  112. package/python/lib/python3.14/__pycache__/pty.cpython-314.pyc +0 -0
  113. package/python/lib/python3.14/__pycache__/py_compile.cpython-314.pyc +0 -0
  114. package/python/lib/python3.14/__pycache__/pyclbr.cpython-314.pyc +0 -0
  115. package/python/lib/python3.14/__pycache__/pydoc.cpython-314.pyc +0 -0
  116. package/python/lib/python3.14/__pycache__/queue.cpython-314.pyc +0 -0
  117. package/python/lib/python3.14/__pycache__/quopri.cpython-314.pyc +0 -0
  118. package/python/lib/python3.14/__pycache__/random.cpython-314.pyc +0 -0
  119. package/python/lib/python3.14/__pycache__/reprlib.cpython-314.pyc +0 -0
  120. package/python/lib/python3.14/__pycache__/rlcompleter.cpython-314.pyc +0 -0
  121. package/python/lib/python3.14/__pycache__/runpy.cpython-314.pyc +0 -0
  122. package/python/lib/python3.14/__pycache__/sched.cpython-314.pyc +0 -0
  123. package/python/lib/python3.14/__pycache__/secrets.cpython-314.pyc +0 -0
  124. package/python/lib/python3.14/__pycache__/selectors.cpython-314.pyc +0 -0
  125. package/python/lib/python3.14/__pycache__/shelve.cpython-314.pyc +0 -0
  126. package/python/lib/python3.14/__pycache__/shlex.cpython-314.pyc +0 -0
  127. package/python/lib/python3.14/__pycache__/shutil.cpython-314.pyc +0 -0
  128. package/python/lib/python3.14/__pycache__/signal.cpython-314.pyc +0 -0
  129. package/python/lib/python3.14/__pycache__/site.cpython-314.pyc +0 -0
  130. package/python/lib/python3.14/__pycache__/smtplib.cpython-314.pyc +0 -0
  131. package/python/lib/python3.14/__pycache__/socket.cpython-314.pyc +0 -0
  132. package/python/lib/python3.14/__pycache__/socketserver.cpython-314.pyc +0 -0
  133. package/python/lib/python3.14/__pycache__/sre_compile.cpython-314.pyc +0 -0
  134. package/python/lib/python3.14/__pycache__/sre_constants.cpython-314.pyc +0 -0
  135. package/python/lib/python3.14/__pycache__/sre_parse.cpython-314.pyc +0 -0
  136. package/python/lib/python3.14/__pycache__/ssl.cpython-314.pyc +0 -0
  137. package/python/lib/python3.14/__pycache__/stat.cpython-314.pyc +0 -0
  138. package/python/lib/python3.14/__pycache__/statistics.cpython-314.pyc +0 -0
  139. package/python/lib/python3.14/__pycache__/stringprep.cpython-314.pyc +0 -0
  140. package/python/lib/python3.14/__pycache__/struct.cpython-314.pyc +0 -0
  141. package/python/lib/python3.14/__pycache__/subprocess.cpython-314.pyc +0 -0
  142. package/python/lib/python3.14/__pycache__/symtable.cpython-314.pyc +0 -0
  143. package/python/lib/python3.14/__pycache__/tabnanny.cpython-314.pyc +0 -0
  144. package/python/lib/python3.14/__pycache__/tarfile.cpython-314.pyc +0 -0
  145. package/python/lib/python3.14/__pycache__/tempfile.cpython-314.pyc +0 -0
  146. package/python/lib/python3.14/__pycache__/textwrap.cpython-314.pyc +0 -0
  147. package/python/lib/python3.14/__pycache__/this.cpython-314.pyc +0 -0
  148. package/python/lib/python3.14/__pycache__/threading.cpython-314.pyc +0 -0
  149. package/python/lib/python3.14/__pycache__/timeit.cpython-314.pyc +0 -0
  150. package/python/lib/python3.14/__pycache__/token.cpython-314.pyc +0 -0
  151. package/python/lib/python3.14/__pycache__/tokenize.cpython-314.pyc +0 -0
  152. package/python/lib/python3.14/__pycache__/trace.cpython-314.pyc +0 -0
  153. package/python/lib/python3.14/__pycache__/traceback.cpython-314.pyc +0 -0
  154. package/python/lib/python3.14/__pycache__/tracemalloc.cpython-314.pyc +0 -0
  155. package/python/lib/python3.14/__pycache__/tty.cpython-314.pyc +0 -0
  156. package/python/lib/python3.14/__pycache__/types.cpython-314.pyc +0 -0
  157. package/python/lib/python3.14/__pycache__/typing.cpython-314.pyc +0 -0
  158. package/python/lib/python3.14/__pycache__/uuid.cpython-314.pyc +0 -0
  159. package/python/lib/python3.14/__pycache__/warnings.cpython-314.pyc +0 -0
  160. package/python/lib/python3.14/__pycache__/wave.cpython-314.pyc +0 -0
  161. package/python/lib/python3.14/__pycache__/weakref.cpython-314.pyc +0 -0
  162. package/python/lib/python3.14/__pycache__/webbrowser.cpython-314.pyc +0 -0
  163. package/python/lib/python3.14/__pycache__/zipapp.cpython-314.pyc +0 -0
  164. package/python/lib/python3.14/__pycache__/zipimport.cpython-314.pyc +0 -0
  165. package/python/lib/python3.14/_aix_support.py +108 -0
  166. package/python/lib/python3.14/_android_support.py +192 -0
  167. package/python/lib/python3.14/_apple_support.py +66 -0
  168. package/python/lib/python3.14/_ast_unparse.py +1161 -0
  169. package/python/lib/python3.14/_collections_abc.py +1172 -0
  170. package/python/lib/python3.14/_colorize.py +355 -0
  171. package/python/lib/python3.14/_compat_pickle.py +251 -0
  172. package/python/lib/python3.14/_ios_support.py +74 -0
  173. package/python/lib/python3.14/_markupbase.py +396 -0
  174. package/python/lib/python3.14/_opcode_metadata.py +371 -0
  175. package/python/lib/python3.14/_osx_support.py +579 -0
  176. package/python/lib/python3.14/_py_abc.py +152 -0
  177. package/python/lib/python3.14/_py_warnings.py +869 -0
  178. package/python/lib/python3.14/_pydatetime.py +2734 -0
  179. package/python/lib/python3.14/_pydecimal.py +6503 -0
  180. package/python/lib/python3.14/_pyio.py +2764 -0
  181. package/python/lib/python3.14/_pylong.py +729 -0
  182. package/python/lib/python3.14/_pyrepl/__init__.py +19 -0
  183. package/python/lib/python3.14/_pyrepl/__main__.py +10 -0
  184. package/python/lib/python3.14/_pyrepl/__pycache__/__init__.cpython-314.pyc +0 -0
  185. package/python/lib/python3.14/_pyrepl/__pycache__/__main__.cpython-314.pyc +0 -0
  186. package/python/lib/python3.14/_pyrepl/__pycache__/_module_completer.cpython-314.pyc +0 -0
  187. package/python/lib/python3.14/_pyrepl/__pycache__/_threading_handler.cpython-314.pyc +0 -0
  188. package/python/lib/python3.14/_pyrepl/__pycache__/base_eventqueue.cpython-314.pyc +0 -0
  189. package/python/lib/python3.14/_pyrepl/__pycache__/commands.cpython-314.pyc +0 -0
  190. package/python/lib/python3.14/_pyrepl/__pycache__/completing_reader.cpython-314.pyc +0 -0
  191. package/python/lib/python3.14/_pyrepl/__pycache__/console.cpython-314.pyc +0 -0
  192. package/python/lib/python3.14/_pyrepl/__pycache__/fancy_termios.cpython-314.pyc +0 -0
  193. package/python/lib/python3.14/_pyrepl/__pycache__/historical_reader.cpython-314.pyc +0 -0
  194. package/python/lib/python3.14/_pyrepl/__pycache__/input.cpython-314.pyc +0 -0
  195. package/python/lib/python3.14/_pyrepl/__pycache__/keymap.cpython-314.pyc +0 -0
  196. package/python/lib/python3.14/_pyrepl/__pycache__/main.cpython-314.pyc +0 -0
  197. package/python/lib/python3.14/_pyrepl/__pycache__/pager.cpython-314.pyc +0 -0
  198. package/python/lib/python3.14/_pyrepl/__pycache__/reader.cpython-314.pyc +0 -0
  199. package/python/lib/python3.14/_pyrepl/__pycache__/readline.cpython-314.pyc +0 -0
  200. package/python/lib/python3.14/_pyrepl/__pycache__/simple_interact.cpython-314.pyc +0 -0
  201. package/python/lib/python3.14/_pyrepl/__pycache__/terminfo.cpython-314.pyc +0 -0
  202. package/python/lib/python3.14/_pyrepl/__pycache__/trace.cpython-314.pyc +0 -0
  203. package/python/lib/python3.14/_pyrepl/__pycache__/types.cpython-314.pyc +0 -0
  204. package/python/lib/python3.14/_pyrepl/__pycache__/unix_console.cpython-314.pyc +0 -0
  205. package/python/lib/python3.14/_pyrepl/__pycache__/unix_eventqueue.cpython-314.pyc +0 -0
  206. package/python/lib/python3.14/_pyrepl/__pycache__/utils.cpython-314.pyc +0 -0
  207. package/python/lib/python3.14/_pyrepl/__pycache__/windows_console.cpython-314.pyc +0 -0
  208. package/python/lib/python3.14/_pyrepl/__pycache__/windows_eventqueue.cpython-314.pyc +0 -0
  209. package/python/lib/python3.14/_pyrepl/_module_completer.py +426 -0
  210. package/python/lib/python3.14/_pyrepl/_threading_handler.py +74 -0
  211. package/python/lib/python3.14/_pyrepl/base_eventqueue.py +110 -0
  212. package/python/lib/python3.14/_pyrepl/commands.py +505 -0
  213. package/python/lib/python3.14/_pyrepl/completing_reader.py +299 -0
  214. package/python/lib/python3.14/_pyrepl/console.py +229 -0
  215. package/python/lib/python3.14/_pyrepl/fancy_termios.py +82 -0
  216. package/python/lib/python3.14/_pyrepl/historical_reader.py +424 -0
  217. package/python/lib/python3.14/_pyrepl/input.py +114 -0
  218. package/python/lib/python3.14/_pyrepl/keymap.py +213 -0
  219. package/python/lib/python3.14/_pyrepl/main.py +58 -0
  220. package/python/lib/python3.14/_pyrepl/mypy.ini +25 -0
  221. package/python/lib/python3.14/_pyrepl/pager.py +175 -0
  222. package/python/lib/python3.14/_pyrepl/reader.py +773 -0
  223. package/python/lib/python3.14/_pyrepl/readline.py +621 -0
  224. package/python/lib/python3.14/_pyrepl/simple_interact.py +186 -0
  225. package/python/lib/python3.14/_pyrepl/terminfo.py +488 -0
  226. package/python/lib/python3.14/_pyrepl/trace.py +34 -0
  227. package/python/lib/python3.14/_pyrepl/types.py +10 -0
  228. package/python/lib/python3.14/_pyrepl/unix_console.py +860 -0
  229. package/python/lib/python3.14/_pyrepl/unix_eventqueue.py +77 -0
  230. package/python/lib/python3.14/_pyrepl/utils.py +391 -0
  231. package/python/lib/python3.14/_pyrepl/windows_console.py +735 -0
  232. package/python/lib/python3.14/_pyrepl/windows_eventqueue.py +42 -0
  233. package/python/lib/python3.14/_sitebuiltins.py +91 -0
  234. package/python/lib/python3.14/_strptime.py +822 -0
  235. package/python/lib/python3.14/_sysconfig_vars__linux_s390x-linux-gnu.json +1166 -0
  236. package/python/lib/python3.14/_sysconfigdata__linux_s390x-linux-gnu.py +1152 -0
  237. package/python/lib/python3.14/_threading_local.py +120 -0
  238. package/python/lib/python3.14/_weakrefset.py +147 -0
  239. package/python/lib/python3.14/abc.py +188 -0
  240. package/python/lib/python3.14/annotationlib.py +1205 -0
  241. package/python/lib/python3.14/antigravity.py +17 -0
  242. package/python/lib/python3.14/argparse.py +2789 -0
  243. package/python/lib/python3.14/ast.py +680 -0
  244. package/python/lib/python3.14/asyncio/__init__.py +74 -0
  245. package/python/lib/python3.14/asyncio/__main__.py +248 -0
  246. package/python/lib/python3.14/asyncio/__pycache__/__init__.cpython-314.pyc +0 -0
  247. package/python/lib/python3.14/asyncio/__pycache__/__main__.cpython-314.pyc +0 -0
  248. package/python/lib/python3.14/asyncio/__pycache__/base_events.cpython-314.pyc +0 -0
  249. package/python/lib/python3.14/asyncio/__pycache__/base_futures.cpython-314.pyc +0 -0
  250. package/python/lib/python3.14/asyncio/__pycache__/base_subprocess.cpython-314.pyc +0 -0
  251. package/python/lib/python3.14/asyncio/__pycache__/base_tasks.cpython-314.pyc +0 -0
  252. package/python/lib/python3.14/asyncio/__pycache__/constants.cpython-314.pyc +0 -0
  253. package/python/lib/python3.14/asyncio/__pycache__/coroutines.cpython-314.pyc +0 -0
  254. package/python/lib/python3.14/asyncio/__pycache__/events.cpython-314.pyc +0 -0
  255. package/python/lib/python3.14/asyncio/__pycache__/exceptions.cpython-314.pyc +0 -0
  256. package/python/lib/python3.14/asyncio/__pycache__/format_helpers.cpython-314.pyc +0 -0
  257. package/python/lib/python3.14/asyncio/__pycache__/futures.cpython-314.pyc +0 -0
  258. package/python/lib/python3.14/asyncio/__pycache__/graph.cpython-314.pyc +0 -0
  259. package/python/lib/python3.14/asyncio/__pycache__/locks.cpython-314.pyc +0 -0
  260. package/python/lib/python3.14/asyncio/__pycache__/log.cpython-314.pyc +0 -0
  261. package/python/lib/python3.14/asyncio/__pycache__/mixins.cpython-314.pyc +0 -0
  262. package/python/lib/python3.14/asyncio/__pycache__/proactor_events.cpython-314.pyc +0 -0
  263. package/python/lib/python3.14/asyncio/__pycache__/protocols.cpython-314.pyc +0 -0
  264. package/python/lib/python3.14/asyncio/__pycache__/queues.cpython-314.pyc +0 -0
  265. package/python/lib/python3.14/asyncio/__pycache__/runners.cpython-314.pyc +0 -0
  266. package/python/lib/python3.14/asyncio/__pycache__/selector_events.cpython-314.pyc +0 -0
  267. package/python/lib/python3.14/asyncio/__pycache__/sslproto.cpython-314.pyc +0 -0
  268. package/python/lib/python3.14/asyncio/__pycache__/staggered.cpython-314.pyc +0 -0
  269. package/python/lib/python3.14/asyncio/__pycache__/streams.cpython-314.pyc +0 -0
  270. package/python/lib/python3.14/asyncio/__pycache__/subprocess.cpython-314.pyc +0 -0
  271. package/python/lib/python3.14/asyncio/__pycache__/taskgroups.cpython-314.pyc +0 -0
  272. package/python/lib/python3.14/asyncio/__pycache__/tasks.cpython-314.pyc +0 -0
  273. package/python/lib/python3.14/asyncio/__pycache__/threads.cpython-314.pyc +0 -0
  274. package/python/lib/python3.14/asyncio/__pycache__/timeouts.cpython-314.pyc +0 -0
  275. package/python/lib/python3.14/asyncio/__pycache__/tools.cpython-314.pyc +0 -0
  276. package/python/lib/python3.14/asyncio/__pycache__/transports.cpython-314.pyc +0 -0
  277. package/python/lib/python3.14/asyncio/__pycache__/trsock.cpython-314.pyc +0 -0
  278. package/python/lib/python3.14/asyncio/__pycache__/unix_events.cpython-314.pyc +0 -0
  279. package/python/lib/python3.14/asyncio/__pycache__/windows_events.cpython-314.pyc +0 -0
  280. package/python/lib/python3.14/asyncio/__pycache__/windows_utils.cpython-314.pyc +0 -0
  281. package/python/lib/python3.14/asyncio/base_events.py +2089 -0
  282. package/python/lib/python3.14/asyncio/base_futures.py +67 -0
  283. package/python/lib/python3.14/asyncio/base_subprocess.py +327 -0
  284. package/python/lib/python3.14/asyncio/base_tasks.py +94 -0
  285. package/python/lib/python3.14/asyncio/constants.py +41 -0
  286. package/python/lib/python3.14/asyncio/coroutines.py +118 -0
  287. package/python/lib/python3.14/asyncio/events.py +881 -0
  288. package/python/lib/python3.14/asyncio/exceptions.py +62 -0
  289. package/python/lib/python3.14/asyncio/format_helpers.py +84 -0
  290. package/python/lib/python3.14/asyncio/futures.py +481 -0
  291. package/python/lib/python3.14/asyncio/graph.py +279 -0
  292. package/python/lib/python3.14/asyncio/locks.py +617 -0
  293. package/python/lib/python3.14/asyncio/log.py +7 -0
  294. package/python/lib/python3.14/asyncio/mixins.py +21 -0
  295. package/python/lib/python3.14/asyncio/proactor_events.py +923 -0
  296. package/python/lib/python3.14/asyncio/protocols.py +216 -0
  297. package/python/lib/python3.14/asyncio/queues.py +309 -0
  298. package/python/lib/python3.14/asyncio/runners.py +226 -0
  299. package/python/lib/python3.14/asyncio/selector_events.py +1337 -0
  300. package/python/lib/python3.14/asyncio/sslproto.py +937 -0
  301. package/python/lib/python3.14/asyncio/staggered.py +179 -0
  302. package/python/lib/python3.14/asyncio/streams.py +804 -0
  303. package/python/lib/python3.14/asyncio/subprocess.py +229 -0
  304. package/python/lib/python3.14/asyncio/taskgroups.py +280 -0
  305. package/python/lib/python3.14/asyncio/tasks.py +1145 -0
  306. package/python/lib/python3.14/asyncio/threads.py +26 -0
  307. package/python/lib/python3.14/asyncio/timeouts.py +183 -0
  308. package/python/lib/python3.14/asyncio/tools.py +278 -0
  309. package/python/lib/python3.14/asyncio/transports.py +337 -0
  310. package/python/lib/python3.14/asyncio/trsock.py +98 -0
  311. package/python/lib/python3.14/asyncio/unix_events.py +1031 -0
  312. package/python/lib/python3.14/asyncio/windows_events.py +906 -0
  313. package/python/lib/python3.14/asyncio/windows_utils.py +181 -0
  314. package/python/lib/python3.14/base64.py +625 -0
  315. package/python/lib/python3.14/bdb.py +1214 -0
  316. package/python/lib/python3.14/bisect.py +118 -0
  317. package/python/lib/python3.14/build-details.json +58 -0
  318. package/python/lib/python3.14/bz2.py +352 -0
  319. package/python/lib/python3.14/cProfile.py +207 -0
  320. package/python/lib/python3.14/calendar.py +926 -0
  321. package/python/lib/python3.14/cmd.py +414 -0
  322. package/python/lib/python3.14/code.py +396 -0
  323. package/python/lib/python3.14/codecs.py +1125 -0
  324. package/python/lib/python3.14/codeop.py +154 -0
  325. package/python/lib/python3.14/collections/__init__.py +1612 -0
  326. package/python/lib/python3.14/collections/__pycache__/__init__.cpython-314.pyc +0 -0
  327. package/python/lib/python3.14/colorsys.py +166 -0
  328. package/python/lib/python3.14/compileall.py +472 -0
  329. package/python/lib/python3.14/compression/__init__.py +0 -0
  330. package/python/lib/python3.14/compression/__pycache__/__init__.cpython-314.pyc +0 -0
  331. package/python/lib/python3.14/compression/__pycache__/bz2.cpython-314.pyc +0 -0
  332. package/python/lib/python3.14/compression/__pycache__/gzip.cpython-314.pyc +0 -0
  333. package/python/lib/python3.14/compression/__pycache__/lzma.cpython-314.pyc +0 -0
  334. package/python/lib/python3.14/compression/__pycache__/zlib.cpython-314.pyc +0 -0
  335. package/python/lib/python3.14/compression/_common/__init__.py +0 -0
  336. package/python/lib/python3.14/compression/_common/__pycache__/__init__.cpython-314.pyc +0 -0
  337. package/python/lib/python3.14/compression/_common/__pycache__/_streams.cpython-314.pyc +0 -0
  338. package/python/lib/python3.14/compression/_common/_streams.py +162 -0
  339. package/python/lib/python3.14/compression/bz2.py +5 -0
  340. package/python/lib/python3.14/compression/gzip.py +5 -0
  341. package/python/lib/python3.14/compression/lzma.py +5 -0
  342. package/python/lib/python3.14/compression/zlib.py +5 -0
  343. package/python/lib/python3.14/compression/zstd/__init__.py +244 -0
  344. package/python/lib/python3.14/compression/zstd/__pycache__/__init__.cpython-314.pyc +0 -0
  345. package/python/lib/python3.14/compression/zstd/__pycache__/_zstdfile.cpython-314.pyc +0 -0
  346. package/python/lib/python3.14/compression/zstd/_zstdfile.py +347 -0
  347. package/python/lib/python3.14/concurrent/__init__.py +1 -0
  348. package/python/lib/python3.14/concurrent/__pycache__/__init__.cpython-314.pyc +0 -0
  349. package/python/lib/python3.14/concurrent/futures/__init__.py +65 -0
  350. package/python/lib/python3.14/concurrent/futures/__pycache__/__init__.cpython-314.pyc +0 -0
  351. package/python/lib/python3.14/concurrent/futures/__pycache__/_base.cpython-314.pyc +0 -0
  352. package/python/lib/python3.14/concurrent/futures/__pycache__/interpreter.cpython-314.pyc +0 -0
  353. package/python/lib/python3.14/concurrent/futures/__pycache__/process.cpython-314.pyc +0 -0
  354. package/python/lib/python3.14/concurrent/futures/__pycache__/thread.cpython-314.pyc +0 -0
  355. package/python/lib/python3.14/concurrent/futures/_base.py +680 -0
  356. package/python/lib/python3.14/concurrent/futures/interpreter.py +123 -0
  357. package/python/lib/python3.14/concurrent/futures/process.py +1047 -0
  358. package/python/lib/python3.14/concurrent/futures/thread.py +274 -0
  359. package/python/lib/python3.14/concurrent/interpreters/__init__.py +253 -0
  360. package/python/lib/python3.14/concurrent/interpreters/__pycache__/__init__.cpython-314.pyc +0 -0
  361. package/python/lib/python3.14/concurrent/interpreters/__pycache__/_crossinterp.cpython-314.pyc +0 -0
  362. package/python/lib/python3.14/concurrent/interpreters/__pycache__/_queues.cpython-314.pyc +0 -0
  363. package/python/lib/python3.14/concurrent/interpreters/_crossinterp.py +107 -0
  364. package/python/lib/python3.14/concurrent/interpreters/_queues.py +290 -0
  365. package/python/lib/python3.14/configparser.py +1426 -0
  366. package/python/lib/python3.14/contextlib.py +814 -0
  367. package/python/lib/python3.14/contextvars.py +8 -0
  368. package/python/lib/python3.14/copy.py +286 -0
  369. package/python/lib/python3.14/copyreg.py +222 -0
  370. package/python/lib/python3.14/csv.py +527 -0
  371. package/python/lib/python3.14/ctypes/__init__.py +686 -0
  372. package/python/lib/python3.14/ctypes/__pycache__/__init__.cpython-314.pyc +0 -0
  373. package/python/lib/python3.14/ctypes/__pycache__/_aix.cpython-314.pyc +0 -0
  374. package/python/lib/python3.14/ctypes/__pycache__/_endian.cpython-314.pyc +0 -0
  375. package/python/lib/python3.14/ctypes/__pycache__/_layout.cpython-314.pyc +0 -0
  376. package/python/lib/python3.14/ctypes/__pycache__/util.cpython-314.pyc +0 -0
  377. package/python/lib/python3.14/ctypes/__pycache__/wintypes.cpython-314.pyc +0 -0
  378. package/python/lib/python3.14/ctypes/_aix.py +327 -0
  379. package/python/lib/python3.14/ctypes/_endian.py +78 -0
  380. package/python/lib/python3.14/ctypes/_layout.py +330 -0
  381. package/python/lib/python3.14/ctypes/macholib/README.ctypes +7 -0
  382. package/python/lib/python3.14/ctypes/macholib/__init__.py +9 -0
  383. package/python/lib/python3.14/ctypes/macholib/__pycache__/__init__.cpython-314.pyc +0 -0
  384. package/python/lib/python3.14/ctypes/macholib/__pycache__/dyld.cpython-314.pyc +0 -0
  385. package/python/lib/python3.14/ctypes/macholib/__pycache__/dylib.cpython-314.pyc +0 -0
  386. package/python/lib/python3.14/ctypes/macholib/__pycache__/framework.cpython-314.pyc +0 -0
  387. package/python/lib/python3.14/ctypes/macholib/dyld.py +165 -0
  388. package/python/lib/python3.14/ctypes/macholib/dylib.py +42 -0
  389. package/python/lib/python3.14/ctypes/macholib/fetch_macholib +2 -0
  390. package/python/lib/python3.14/ctypes/macholib/fetch_macholib.bat +1 -0
  391. package/python/lib/python3.14/ctypes/macholib/framework.py +42 -0
  392. package/python/lib/python3.14/ctypes/util.py +502 -0
  393. package/python/lib/python3.14/ctypes/wintypes.py +210 -0
  394. package/python/lib/python3.14/curses/__init__.py +101 -0
  395. package/python/lib/python3.14/curses/__pycache__/__init__.cpython-314.pyc +0 -0
  396. package/python/lib/python3.14/curses/__pycache__/ascii.cpython-314.pyc +0 -0
  397. package/python/lib/python3.14/curses/__pycache__/has_key.cpython-314.pyc +0 -0
  398. package/python/lib/python3.14/curses/__pycache__/panel.cpython-314.pyc +0 -0
  399. package/python/lib/python3.14/curses/__pycache__/textpad.cpython-314.pyc +0 -0
  400. package/python/lib/python3.14/curses/ascii.py +99 -0
  401. package/python/lib/python3.14/curses/has_key.py +192 -0
  402. package/python/lib/python3.14/curses/panel.py +6 -0
  403. package/python/lib/python3.14/curses/textpad.py +236 -0
  404. package/python/lib/python3.14/dataclasses.py +1813 -0
  405. package/python/lib/python3.14/datetime.py +13 -0
  406. package/python/lib/python3.14/dbm/__init__.py +194 -0
  407. package/python/lib/python3.14/dbm/__pycache__/__init__.cpython-314.pyc +0 -0
  408. package/python/lib/python3.14/dbm/__pycache__/dumb.cpython-314.pyc +0 -0
  409. package/python/lib/python3.14/dbm/__pycache__/gnu.cpython-314.pyc +0 -0
  410. package/python/lib/python3.14/dbm/__pycache__/ndbm.cpython-314.pyc +0 -0
  411. package/python/lib/python3.14/dbm/__pycache__/sqlite3.cpython-314.pyc +0 -0
  412. package/python/lib/python3.14/dbm/dumb.py +319 -0
  413. package/python/lib/python3.14/dbm/gnu.py +3 -0
  414. package/python/lib/python3.14/dbm/ndbm.py +3 -0
  415. package/python/lib/python3.14/dbm/sqlite3.py +144 -0
  416. package/python/lib/python3.14/decimal.py +109 -0
  417. package/python/lib/python3.14/difflib.py +2066 -0
  418. package/python/lib/python3.14/dis.py +1157 -0
  419. package/python/lib/python3.14/doctest.py +2922 -0
  420. package/python/lib/python3.14/email/__init__.py +61 -0
  421. package/python/lib/python3.14/email/__pycache__/__init__.cpython-314.pyc +0 -0
  422. package/python/lib/python3.14/email/__pycache__/_encoded_words.cpython-314.pyc +0 -0
  423. package/python/lib/python3.14/email/__pycache__/_header_value_parser.cpython-314.pyc +0 -0
  424. package/python/lib/python3.14/email/__pycache__/_parseaddr.cpython-314.pyc +0 -0
  425. package/python/lib/python3.14/email/__pycache__/_policybase.cpython-314.pyc +0 -0
  426. package/python/lib/python3.14/email/__pycache__/base64mime.cpython-314.pyc +0 -0
  427. package/python/lib/python3.14/email/__pycache__/charset.cpython-314.pyc +0 -0
  428. package/python/lib/python3.14/email/__pycache__/contentmanager.cpython-314.pyc +0 -0
  429. package/python/lib/python3.14/email/__pycache__/encoders.cpython-314.pyc +0 -0
  430. package/python/lib/python3.14/email/__pycache__/errors.cpython-314.pyc +0 -0
  431. package/python/lib/python3.14/email/__pycache__/feedparser.cpython-314.pyc +0 -0
  432. package/python/lib/python3.14/email/__pycache__/generator.cpython-314.pyc +0 -0
  433. package/python/lib/python3.14/email/__pycache__/header.cpython-314.pyc +0 -0
  434. package/python/lib/python3.14/email/__pycache__/headerregistry.cpython-314.pyc +0 -0
  435. package/python/lib/python3.14/email/__pycache__/iterators.cpython-314.pyc +0 -0
  436. package/python/lib/python3.14/email/__pycache__/message.cpython-314.pyc +0 -0
  437. package/python/lib/python3.14/email/__pycache__/parser.cpython-314.pyc +0 -0
  438. package/python/lib/python3.14/email/__pycache__/policy.cpython-314.pyc +0 -0
  439. package/python/lib/python3.14/email/__pycache__/quoprimime.cpython-314.pyc +0 -0
  440. package/python/lib/python3.14/email/__pycache__/utils.cpython-314.pyc +0 -0
  441. package/python/lib/python3.14/email/_encoded_words.py +233 -0
  442. package/python/lib/python3.14/email/_header_value_parser.py +3164 -0
  443. package/python/lib/python3.14/email/_parseaddr.py +563 -0
  444. package/python/lib/python3.14/email/_policybase.py +392 -0
  445. package/python/lib/python3.14/email/architecture.rst +216 -0
  446. package/python/lib/python3.14/email/base64mime.py +115 -0
  447. package/python/lib/python3.14/email/charset.py +396 -0
  448. package/python/lib/python3.14/email/contentmanager.py +254 -0
  449. package/python/lib/python3.14/email/encoders.py +65 -0
  450. package/python/lib/python3.14/email/errors.py +117 -0
  451. package/python/lib/python3.14/email/feedparser.py +536 -0
  452. package/python/lib/python3.14/email/generator.py +530 -0
  453. package/python/lib/python3.14/email/header.py +582 -0
  454. package/python/lib/python3.14/email/headerregistry.py +618 -0
  455. package/python/lib/python3.14/email/iterators.py +68 -0
  456. package/python/lib/python3.14/email/message.py +1217 -0
  457. package/python/lib/python3.14/email/mime/__init__.py +0 -0
  458. package/python/lib/python3.14/email/mime/__pycache__/__init__.cpython-314.pyc +0 -0
  459. package/python/lib/python3.14/email/mime/__pycache__/application.cpython-314.pyc +0 -0
  460. package/python/lib/python3.14/email/mime/__pycache__/audio.cpython-314.pyc +0 -0
  461. package/python/lib/python3.14/email/mime/__pycache__/base.cpython-314.pyc +0 -0
  462. package/python/lib/python3.14/email/mime/__pycache__/image.cpython-314.pyc +0 -0
  463. package/python/lib/python3.14/email/mime/__pycache__/message.cpython-314.pyc +0 -0
  464. package/python/lib/python3.14/email/mime/__pycache__/multipart.cpython-314.pyc +0 -0
  465. package/python/lib/python3.14/email/mime/__pycache__/nonmultipart.cpython-314.pyc +0 -0
  466. package/python/lib/python3.14/email/mime/__pycache__/text.cpython-314.pyc +0 -0
  467. package/python/lib/python3.14/email/mime/application.py +37 -0
  468. package/python/lib/python3.14/email/mime/audio.py +97 -0
  469. package/python/lib/python3.14/email/mime/base.py +29 -0
  470. package/python/lib/python3.14/email/mime/image.py +152 -0
  471. package/python/lib/python3.14/email/mime/message.py +33 -0
  472. package/python/lib/python3.14/email/mime/multipart.py +47 -0
  473. package/python/lib/python3.14/email/mime/nonmultipart.py +21 -0
  474. package/python/lib/python3.14/email/mime/text.py +40 -0
  475. package/python/lib/python3.14/email/parser.py +127 -0
  476. package/python/lib/python3.14/email/policy.py +239 -0
  477. package/python/lib/python3.14/email/quoprimime.py +300 -0
  478. package/python/lib/python3.14/email/utils.py +489 -0
  479. package/python/lib/python3.14/encodings/__init__.py +182 -0
  480. package/python/lib/python3.14/encodings/__pycache__/__init__.cpython-314.pyc +0 -0
  481. package/python/lib/python3.14/encodings/__pycache__/_win_cp_codecs.cpython-314.pyc +0 -0
  482. package/python/lib/python3.14/encodings/__pycache__/aliases.cpython-314.pyc +0 -0
  483. package/python/lib/python3.14/encodings/__pycache__/ascii.cpython-314.pyc +0 -0
  484. package/python/lib/python3.14/encodings/__pycache__/base64_codec.cpython-314.pyc +0 -0
  485. package/python/lib/python3.14/encodings/__pycache__/big5.cpython-314.pyc +0 -0
  486. package/python/lib/python3.14/encodings/__pycache__/big5hkscs.cpython-314.pyc +0 -0
  487. package/python/lib/python3.14/encodings/__pycache__/bz2_codec.cpython-314.pyc +0 -0
  488. package/python/lib/python3.14/encodings/__pycache__/charmap.cpython-314.pyc +0 -0
  489. package/python/lib/python3.14/encodings/__pycache__/cp037.cpython-314.pyc +0 -0
  490. package/python/lib/python3.14/encodings/__pycache__/cp1006.cpython-314.pyc +0 -0
  491. package/python/lib/python3.14/encodings/__pycache__/cp1026.cpython-314.pyc +0 -0
  492. package/python/lib/python3.14/encodings/__pycache__/cp1125.cpython-314.pyc +0 -0
  493. package/python/lib/python3.14/encodings/__pycache__/cp1140.cpython-314.pyc +0 -0
  494. package/python/lib/python3.14/encodings/__pycache__/cp1250.cpython-314.pyc +0 -0
  495. package/python/lib/python3.14/encodings/__pycache__/cp1251.cpython-314.pyc +0 -0
  496. package/python/lib/python3.14/encodings/__pycache__/cp1252.cpython-314.pyc +0 -0
  497. package/python/lib/python3.14/encodings/__pycache__/cp1253.cpython-314.pyc +0 -0
  498. package/python/lib/python3.14/encodings/__pycache__/cp1254.cpython-314.pyc +0 -0
  499. package/python/lib/python3.14/encodings/__pycache__/cp1255.cpython-314.pyc +0 -0
  500. package/python/lib/python3.14/encodings/__pycache__/cp1256.cpython-314.pyc +0 -0
  501. package/python/lib/python3.14/encodings/__pycache__/cp1257.cpython-314.pyc +0 -0
  502. package/python/lib/python3.14/encodings/__pycache__/cp1258.cpython-314.pyc +0 -0
  503. package/python/lib/python3.14/encodings/__pycache__/cp273.cpython-314.pyc +0 -0
  504. package/python/lib/python3.14/encodings/__pycache__/cp424.cpython-314.pyc +0 -0
  505. package/python/lib/python3.14/encodings/__pycache__/cp437.cpython-314.pyc +0 -0
  506. package/python/lib/python3.14/encodings/__pycache__/cp500.cpython-314.pyc +0 -0
  507. package/python/lib/python3.14/encodings/__pycache__/cp720.cpython-314.pyc +0 -0
  508. package/python/lib/python3.14/encodings/__pycache__/cp737.cpython-314.pyc +0 -0
  509. package/python/lib/python3.14/encodings/__pycache__/cp775.cpython-314.pyc +0 -0
  510. package/python/lib/python3.14/encodings/__pycache__/cp850.cpython-314.pyc +0 -0
  511. package/python/lib/python3.14/encodings/__pycache__/cp852.cpython-314.pyc +0 -0
  512. package/python/lib/python3.14/encodings/__pycache__/cp855.cpython-314.pyc +0 -0
  513. package/python/lib/python3.14/encodings/__pycache__/cp856.cpython-314.pyc +0 -0
  514. package/python/lib/python3.14/encodings/__pycache__/cp857.cpython-314.pyc +0 -0
  515. package/python/lib/python3.14/encodings/__pycache__/cp858.cpython-314.pyc +0 -0
  516. package/python/lib/python3.14/encodings/__pycache__/cp860.cpython-314.pyc +0 -0
  517. package/python/lib/python3.14/encodings/__pycache__/cp861.cpython-314.pyc +0 -0
  518. package/python/lib/python3.14/encodings/__pycache__/cp862.cpython-314.pyc +0 -0
  519. package/python/lib/python3.14/encodings/__pycache__/cp863.cpython-314.pyc +0 -0
  520. package/python/lib/python3.14/encodings/__pycache__/cp864.cpython-314.pyc +0 -0
  521. package/python/lib/python3.14/encodings/__pycache__/cp865.cpython-314.pyc +0 -0
  522. package/python/lib/python3.14/encodings/__pycache__/cp866.cpython-314.pyc +0 -0
  523. package/python/lib/python3.14/encodings/__pycache__/cp869.cpython-314.pyc +0 -0
  524. package/python/lib/python3.14/encodings/__pycache__/cp874.cpython-314.pyc +0 -0
  525. package/python/lib/python3.14/encodings/__pycache__/cp875.cpython-314.pyc +0 -0
  526. package/python/lib/python3.14/encodings/__pycache__/cp932.cpython-314.pyc +0 -0
  527. package/python/lib/python3.14/encodings/__pycache__/cp949.cpython-314.pyc +0 -0
  528. package/python/lib/python3.14/encodings/__pycache__/cp950.cpython-314.pyc +0 -0
  529. package/python/lib/python3.14/encodings/__pycache__/euc_jis_2004.cpython-314.pyc +0 -0
  530. package/python/lib/python3.14/encodings/__pycache__/euc_jisx0213.cpython-314.pyc +0 -0
  531. package/python/lib/python3.14/encodings/__pycache__/euc_jp.cpython-314.pyc +0 -0
  532. package/python/lib/python3.14/encodings/__pycache__/euc_kr.cpython-314.pyc +0 -0
  533. package/python/lib/python3.14/encodings/__pycache__/gb18030.cpython-314.pyc +0 -0
  534. package/python/lib/python3.14/encodings/__pycache__/gb2312.cpython-314.pyc +0 -0
  535. package/python/lib/python3.14/encodings/__pycache__/gbk.cpython-314.pyc +0 -0
  536. package/python/lib/python3.14/encodings/__pycache__/hex_codec.cpython-314.pyc +0 -0
  537. package/python/lib/python3.14/encodings/__pycache__/hp_roman8.cpython-314.pyc +0 -0
  538. package/python/lib/python3.14/encodings/__pycache__/hz.cpython-314.pyc +0 -0
  539. package/python/lib/python3.14/encodings/__pycache__/idna.cpython-314.pyc +0 -0
  540. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp.cpython-314.pyc +0 -0
  541. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp_1.cpython-314.pyc +0 -0
  542. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp_2.cpython-314.pyc +0 -0
  543. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp_2004.cpython-314.pyc +0 -0
  544. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp_3.cpython-314.pyc +0 -0
  545. package/python/lib/python3.14/encodings/__pycache__/iso2022_jp_ext.cpython-314.pyc +0 -0
  546. package/python/lib/python3.14/encodings/__pycache__/iso2022_kr.cpython-314.pyc +0 -0
  547. package/python/lib/python3.14/encodings/__pycache__/iso8859_1.cpython-314.pyc +0 -0
  548. package/python/lib/python3.14/encodings/__pycache__/iso8859_10.cpython-314.pyc +0 -0
  549. package/python/lib/python3.14/encodings/__pycache__/iso8859_11.cpython-314.pyc +0 -0
  550. package/python/lib/python3.14/encodings/__pycache__/iso8859_13.cpython-314.pyc +0 -0
  551. package/python/lib/python3.14/encodings/__pycache__/iso8859_14.cpython-314.pyc +0 -0
  552. package/python/lib/python3.14/encodings/__pycache__/iso8859_15.cpython-314.pyc +0 -0
  553. package/python/lib/python3.14/encodings/__pycache__/iso8859_16.cpython-314.pyc +0 -0
  554. package/python/lib/python3.14/encodings/__pycache__/iso8859_2.cpython-314.pyc +0 -0
  555. package/python/lib/python3.14/encodings/__pycache__/iso8859_3.cpython-314.pyc +0 -0
  556. package/python/lib/python3.14/encodings/__pycache__/iso8859_4.cpython-314.pyc +0 -0
  557. package/python/lib/python3.14/encodings/__pycache__/iso8859_5.cpython-314.pyc +0 -0
  558. package/python/lib/python3.14/encodings/__pycache__/iso8859_6.cpython-314.pyc +0 -0
  559. package/python/lib/python3.14/encodings/__pycache__/iso8859_7.cpython-314.pyc +0 -0
  560. package/python/lib/python3.14/encodings/__pycache__/iso8859_8.cpython-314.pyc +0 -0
  561. package/python/lib/python3.14/encodings/__pycache__/iso8859_9.cpython-314.pyc +0 -0
  562. package/python/lib/python3.14/encodings/__pycache__/johab.cpython-314.pyc +0 -0
  563. package/python/lib/python3.14/encodings/__pycache__/koi8_r.cpython-314.pyc +0 -0
  564. package/python/lib/python3.14/encodings/__pycache__/koi8_t.cpython-314.pyc +0 -0
  565. package/python/lib/python3.14/encodings/__pycache__/koi8_u.cpython-314.pyc +0 -0
  566. package/python/lib/python3.14/encodings/__pycache__/kz1048.cpython-314.pyc +0 -0
  567. package/python/lib/python3.14/encodings/__pycache__/latin_1.cpython-314.pyc +0 -0
  568. package/python/lib/python3.14/encodings/__pycache__/mac_arabic.cpython-314.pyc +0 -0
  569. package/python/lib/python3.14/encodings/__pycache__/mac_croatian.cpython-314.pyc +0 -0
  570. package/python/lib/python3.14/encodings/__pycache__/mac_cyrillic.cpython-314.pyc +0 -0
  571. package/python/lib/python3.14/encodings/__pycache__/mac_farsi.cpython-314.pyc +0 -0
  572. package/python/lib/python3.14/encodings/__pycache__/mac_greek.cpython-314.pyc +0 -0
  573. package/python/lib/python3.14/encodings/__pycache__/mac_iceland.cpython-314.pyc +0 -0
  574. package/python/lib/python3.14/encodings/__pycache__/mac_latin2.cpython-314.pyc +0 -0
  575. package/python/lib/python3.14/encodings/__pycache__/mac_roman.cpython-314.pyc +0 -0
  576. package/python/lib/python3.14/encodings/__pycache__/mac_romanian.cpython-314.pyc +0 -0
  577. package/python/lib/python3.14/encodings/__pycache__/mac_turkish.cpython-314.pyc +0 -0
  578. package/python/lib/python3.14/encodings/__pycache__/mbcs.cpython-314.pyc +0 -0
  579. package/python/lib/python3.14/encodings/__pycache__/oem.cpython-314.pyc +0 -0
  580. package/python/lib/python3.14/encodings/__pycache__/palmos.cpython-314.pyc +0 -0
  581. package/python/lib/python3.14/encodings/__pycache__/ptcp154.cpython-314.pyc +0 -0
  582. package/python/lib/python3.14/encodings/__pycache__/punycode.cpython-314.pyc +0 -0
  583. package/python/lib/python3.14/encodings/__pycache__/quopri_codec.cpython-314.pyc +0 -0
  584. package/python/lib/python3.14/encodings/__pycache__/raw_unicode_escape.cpython-314.pyc +0 -0
  585. package/python/lib/python3.14/encodings/__pycache__/rot_13.cpython-314.pyc +0 -0
  586. package/python/lib/python3.14/encodings/__pycache__/shift_jis.cpython-314.pyc +0 -0
  587. package/python/lib/python3.14/encodings/__pycache__/shift_jis_2004.cpython-314.pyc +0 -0
  588. package/python/lib/python3.14/encodings/__pycache__/shift_jisx0213.cpython-314.pyc +0 -0
  589. package/python/lib/python3.14/encodings/__pycache__/tis_620.cpython-314.pyc +0 -0
  590. package/python/lib/python3.14/encodings/__pycache__/undefined.cpython-314.pyc +0 -0
  591. package/python/lib/python3.14/encodings/__pycache__/unicode_escape.cpython-314.pyc +0 -0
  592. package/python/lib/python3.14/encodings/__pycache__/utf_16.cpython-314.pyc +0 -0
  593. package/python/lib/python3.14/encodings/__pycache__/utf_16_be.cpython-314.pyc +0 -0
  594. package/python/lib/python3.14/encodings/__pycache__/utf_16_le.cpython-314.pyc +0 -0
  595. package/python/lib/python3.14/encodings/__pycache__/utf_32.cpython-314.pyc +0 -0
  596. package/python/lib/python3.14/encodings/__pycache__/utf_32_be.cpython-314.pyc +0 -0
  597. package/python/lib/python3.14/encodings/__pycache__/utf_32_le.cpython-314.pyc +0 -0
  598. package/python/lib/python3.14/encodings/__pycache__/utf_7.cpython-314.pyc +0 -0
  599. package/python/lib/python3.14/encodings/__pycache__/utf_8.cpython-314.pyc +0 -0
  600. package/python/lib/python3.14/encodings/__pycache__/utf_8_sig.cpython-314.pyc +0 -0
  601. package/python/lib/python3.14/encodings/__pycache__/uu_codec.cpython-314.pyc +0 -0
  602. package/python/lib/python3.14/encodings/__pycache__/zlib_codec.cpython-314.pyc +0 -0
  603. package/python/lib/python3.14/encodings/_win_cp_codecs.py +36 -0
  604. package/python/lib/python3.14/encodings/aliases.py +568 -0
  605. package/python/lib/python3.14/encodings/ascii.py +50 -0
  606. package/python/lib/python3.14/encodings/base64_codec.py +55 -0
  607. package/python/lib/python3.14/encodings/big5.py +39 -0
  608. package/python/lib/python3.14/encodings/big5hkscs.py +39 -0
  609. package/python/lib/python3.14/encodings/bz2_codec.py +78 -0
  610. package/python/lib/python3.14/encodings/charmap.py +69 -0
  611. package/python/lib/python3.14/encodings/cp037.py +307 -0
  612. package/python/lib/python3.14/encodings/cp1006.py +307 -0
  613. package/python/lib/python3.14/encodings/cp1026.py +307 -0
  614. package/python/lib/python3.14/encodings/cp1125.py +698 -0
  615. package/python/lib/python3.14/encodings/cp1140.py +307 -0
  616. package/python/lib/python3.14/encodings/cp1250.py +307 -0
  617. package/python/lib/python3.14/encodings/cp1251.py +307 -0
  618. package/python/lib/python3.14/encodings/cp1252.py +307 -0
  619. package/python/lib/python3.14/encodings/cp1253.py +307 -0
  620. package/python/lib/python3.14/encodings/cp1254.py +307 -0
  621. package/python/lib/python3.14/encodings/cp1255.py +307 -0
  622. package/python/lib/python3.14/encodings/cp1256.py +307 -0
  623. package/python/lib/python3.14/encodings/cp1257.py +307 -0
  624. package/python/lib/python3.14/encodings/cp1258.py +307 -0
  625. package/python/lib/python3.14/encodings/cp273.py +307 -0
  626. package/python/lib/python3.14/encodings/cp424.py +307 -0
  627. package/python/lib/python3.14/encodings/cp437.py +698 -0
  628. package/python/lib/python3.14/encodings/cp500.py +307 -0
  629. package/python/lib/python3.14/encodings/cp720.py +309 -0
  630. package/python/lib/python3.14/encodings/cp737.py +698 -0
  631. package/python/lib/python3.14/encodings/cp775.py +697 -0
  632. package/python/lib/python3.14/encodings/cp850.py +698 -0
  633. package/python/lib/python3.14/encodings/cp852.py +698 -0
  634. package/python/lib/python3.14/encodings/cp855.py +698 -0
  635. package/python/lib/python3.14/encodings/cp856.py +307 -0
  636. package/python/lib/python3.14/encodings/cp857.py +694 -0
  637. package/python/lib/python3.14/encodings/cp858.py +698 -0
  638. package/python/lib/python3.14/encodings/cp860.py +698 -0
  639. package/python/lib/python3.14/encodings/cp861.py +698 -0
  640. package/python/lib/python3.14/encodings/cp862.py +698 -0
  641. package/python/lib/python3.14/encodings/cp863.py +698 -0
  642. package/python/lib/python3.14/encodings/cp864.py +690 -0
  643. package/python/lib/python3.14/encodings/cp865.py +698 -0
  644. package/python/lib/python3.14/encodings/cp866.py +698 -0
  645. package/python/lib/python3.14/encodings/cp869.py +689 -0
  646. package/python/lib/python3.14/encodings/cp874.py +307 -0
  647. package/python/lib/python3.14/encodings/cp875.py +307 -0
  648. package/python/lib/python3.14/encodings/cp932.py +39 -0
  649. package/python/lib/python3.14/encodings/cp949.py +39 -0
  650. package/python/lib/python3.14/encodings/cp950.py +39 -0
  651. package/python/lib/python3.14/encodings/euc_jis_2004.py +39 -0
  652. package/python/lib/python3.14/encodings/euc_jisx0213.py +39 -0
  653. package/python/lib/python3.14/encodings/euc_jp.py +39 -0
  654. package/python/lib/python3.14/encodings/euc_kr.py +39 -0
  655. package/python/lib/python3.14/encodings/gb18030.py +39 -0
  656. package/python/lib/python3.14/encodings/gb2312.py +39 -0
  657. package/python/lib/python3.14/encodings/gbk.py +39 -0
  658. package/python/lib/python3.14/encodings/hex_codec.py +55 -0
  659. package/python/lib/python3.14/encodings/hp_roman8.py +314 -0
  660. package/python/lib/python3.14/encodings/hz.py +39 -0
  661. package/python/lib/python3.14/encodings/idna.py +387 -0
  662. package/python/lib/python3.14/encodings/iso2022_jp.py +39 -0
  663. package/python/lib/python3.14/encodings/iso2022_jp_1.py +39 -0
  664. package/python/lib/python3.14/encodings/iso2022_jp_2.py +39 -0
  665. package/python/lib/python3.14/encodings/iso2022_jp_2004.py +39 -0
  666. package/python/lib/python3.14/encodings/iso2022_jp_3.py +39 -0
  667. package/python/lib/python3.14/encodings/iso2022_jp_ext.py +39 -0
  668. package/python/lib/python3.14/encodings/iso2022_kr.py +39 -0
  669. package/python/lib/python3.14/encodings/iso8859_1.py +307 -0
  670. package/python/lib/python3.14/encodings/iso8859_10.py +307 -0
  671. package/python/lib/python3.14/encodings/iso8859_11.py +307 -0
  672. package/python/lib/python3.14/encodings/iso8859_13.py +307 -0
  673. package/python/lib/python3.14/encodings/iso8859_14.py +307 -0
  674. package/python/lib/python3.14/encodings/iso8859_15.py +307 -0
  675. package/python/lib/python3.14/encodings/iso8859_16.py +307 -0
  676. package/python/lib/python3.14/encodings/iso8859_2.py +307 -0
  677. package/python/lib/python3.14/encodings/iso8859_3.py +307 -0
  678. package/python/lib/python3.14/encodings/iso8859_4.py +307 -0
  679. package/python/lib/python3.14/encodings/iso8859_5.py +307 -0
  680. package/python/lib/python3.14/encodings/iso8859_6.py +307 -0
  681. package/python/lib/python3.14/encodings/iso8859_7.py +307 -0
  682. package/python/lib/python3.14/encodings/iso8859_8.py +307 -0
  683. package/python/lib/python3.14/encodings/iso8859_9.py +307 -0
  684. package/python/lib/python3.14/encodings/johab.py +39 -0
  685. package/python/lib/python3.14/encodings/koi8_r.py +307 -0
  686. package/python/lib/python3.14/encodings/koi8_t.py +308 -0
  687. package/python/lib/python3.14/encodings/koi8_u.py +307 -0
  688. package/python/lib/python3.14/encodings/kz1048.py +307 -0
  689. package/python/lib/python3.14/encodings/latin_1.py +50 -0
  690. package/python/lib/python3.14/encodings/mac_arabic.py +698 -0
  691. package/python/lib/python3.14/encodings/mac_croatian.py +307 -0
  692. package/python/lib/python3.14/encodings/mac_cyrillic.py +307 -0
  693. package/python/lib/python3.14/encodings/mac_farsi.py +307 -0
  694. package/python/lib/python3.14/encodings/mac_greek.py +307 -0
  695. package/python/lib/python3.14/encodings/mac_iceland.py +307 -0
  696. package/python/lib/python3.14/encodings/mac_latin2.py +312 -0
  697. package/python/lib/python3.14/encodings/mac_roman.py +307 -0
  698. package/python/lib/python3.14/encodings/mac_romanian.py +307 -0
  699. package/python/lib/python3.14/encodings/mac_turkish.py +307 -0
  700. package/python/lib/python3.14/encodings/mbcs.py +47 -0
  701. package/python/lib/python3.14/encodings/oem.py +41 -0
  702. package/python/lib/python3.14/encodings/palmos.py +308 -0
  703. package/python/lib/python3.14/encodings/ptcp154.py +312 -0
  704. package/python/lib/python3.14/encodings/punycode.py +253 -0
  705. package/python/lib/python3.14/encodings/quopri_codec.py +56 -0
  706. package/python/lib/python3.14/encodings/raw_unicode_escape.py +46 -0
  707. package/python/lib/python3.14/encodings/rot_13.py +113 -0
  708. package/python/lib/python3.14/encodings/shift_jis.py +39 -0
  709. package/python/lib/python3.14/encodings/shift_jis_2004.py +39 -0
  710. package/python/lib/python3.14/encodings/shift_jisx0213.py +39 -0
  711. package/python/lib/python3.14/encodings/tis_620.py +307 -0
  712. package/python/lib/python3.14/encodings/undefined.py +49 -0
  713. package/python/lib/python3.14/encodings/unicode_escape.py +46 -0
  714. package/python/lib/python3.14/encodings/utf_16.py +155 -0
  715. package/python/lib/python3.14/encodings/utf_16_be.py +42 -0
  716. package/python/lib/python3.14/encodings/utf_16_le.py +42 -0
  717. package/python/lib/python3.14/encodings/utf_32.py +150 -0
  718. package/python/lib/python3.14/encodings/utf_32_be.py +37 -0
  719. package/python/lib/python3.14/encodings/utf_32_le.py +37 -0
  720. package/python/lib/python3.14/encodings/utf_7.py +38 -0
  721. package/python/lib/python3.14/encodings/utf_8.py +42 -0
  722. package/python/lib/python3.14/encodings/utf_8_sig.py +130 -0
  723. package/python/lib/python3.14/encodings/uu_codec.py +103 -0
  724. package/python/lib/python3.14/encodings/zlib_codec.py +77 -0
  725. package/python/lib/python3.14/enum.py +2169 -0
  726. package/python/lib/python3.14/filecmp.py +320 -0
  727. package/python/lib/python3.14/fileinput.py +442 -0
  728. package/python/lib/python3.14/fnmatch.py +209 -0
  729. package/python/lib/python3.14/fractions.py +1078 -0
  730. package/python/lib/python3.14/ftplib.py +975 -0
  731. package/python/lib/python3.14/functools.py +1165 -0
  732. package/python/lib/python3.14/genericpath.py +200 -0
  733. package/python/lib/python3.14/getopt.py +232 -0
  734. package/python/lib/python3.14/getpass.py +256 -0
  735. package/python/lib/python3.14/gettext.py +660 -0
  736. package/python/lib/python3.14/glob.py +574 -0
  737. package/python/lib/python3.14/graphlib.py +254 -0
  738. package/python/lib/python3.14/gzip.py +724 -0
  739. package/python/lib/python3.14/hashlib.py +255 -0
  740. package/python/lib/python3.14/heapq.py +611 -0
  741. package/python/lib/python3.14/hmac.py +279 -0
  742. package/python/lib/python3.14/html/__init__.py +132 -0
  743. package/python/lib/python3.14/html/__pycache__/__init__.cpython-314.pyc +0 -0
  744. package/python/lib/python3.14/html/__pycache__/entities.cpython-314.pyc +0 -0
  745. package/python/lib/python3.14/html/__pycache__/parser.cpython-314.pyc +0 -0
  746. package/python/lib/python3.14/html/entities.py +2513 -0
  747. package/python/lib/python3.14/html/parser.py +583 -0
  748. package/python/lib/python3.14/http/__init__.py +213 -0
  749. package/python/lib/python3.14/http/__pycache__/__init__.cpython-314.pyc +0 -0
  750. package/python/lib/python3.14/http/__pycache__/client.cpython-314.pyc +0 -0
  751. package/python/lib/python3.14/http/__pycache__/cookiejar.cpython-314.pyc +0 -0
  752. package/python/lib/python3.14/http/__pycache__/cookies.cpython-314.pyc +0 -0
  753. package/python/lib/python3.14/http/__pycache__/server.cpython-314.pyc +0 -0
  754. package/python/lib/python3.14/http/client.py +1598 -0
  755. package/python/lib/python3.14/http/cookiejar.py +2135 -0
  756. package/python/lib/python3.14/http/cookies.py +637 -0
  757. package/python/lib/python3.14/http/server.py +1445 -0
  758. package/python/lib/python3.14/imaplib.py +2090 -0
  759. package/python/lib/python3.14/importlib/__init__.py +136 -0
  760. package/python/lib/python3.14/importlib/__pycache__/__init__.cpython-314.pyc +0 -0
  761. package/python/lib/python3.14/importlib/__pycache__/_abc.cpython-314.pyc +0 -0
  762. package/python/lib/python3.14/importlib/__pycache__/_bootstrap.cpython-314.pyc +0 -0
  763. package/python/lib/python3.14/importlib/__pycache__/_bootstrap_external.cpython-314.pyc +0 -0
  764. package/python/lib/python3.14/importlib/__pycache__/abc.cpython-314.pyc +0 -0
  765. package/python/lib/python3.14/importlib/__pycache__/machinery.cpython-314.pyc +0 -0
  766. package/python/lib/python3.14/importlib/__pycache__/readers.cpython-314.pyc +0 -0
  767. package/python/lib/python3.14/importlib/__pycache__/simple.cpython-314.pyc +0 -0
  768. package/python/lib/python3.14/importlib/__pycache__/util.cpython-314.pyc +0 -0
  769. package/python/lib/python3.14/importlib/_abc.py +39 -0
  770. package/python/lib/python3.14/importlib/_bootstrap.py +1570 -0
  771. package/python/lib/python3.14/importlib/_bootstrap_external.py +1566 -0
  772. package/python/lib/python3.14/importlib/abc.py +234 -0
  773. package/python/lib/python3.14/importlib/machinery.py +50 -0
  774. package/python/lib/python3.14/importlib/metadata/__init__.py +1093 -0
  775. package/python/lib/python3.14/importlib/metadata/__pycache__/__init__.cpython-314.pyc +0 -0
  776. package/python/lib/python3.14/importlib/metadata/__pycache__/_adapters.cpython-314.pyc +0 -0
  777. package/python/lib/python3.14/importlib/metadata/__pycache__/_collections.cpython-314.pyc +0 -0
  778. package/python/lib/python3.14/importlib/metadata/__pycache__/_functools.cpython-314.pyc +0 -0
  779. package/python/lib/python3.14/importlib/metadata/__pycache__/_itertools.cpython-314.pyc +0 -0
  780. package/python/lib/python3.14/importlib/metadata/__pycache__/_meta.cpython-314.pyc +0 -0
  781. package/python/lib/python3.14/importlib/metadata/__pycache__/_text.cpython-314.pyc +0 -0
  782. package/python/lib/python3.14/importlib/metadata/__pycache__/diagnose.cpython-314.pyc +0 -0
  783. package/python/lib/python3.14/importlib/metadata/_adapters.py +89 -0
  784. package/python/lib/python3.14/importlib/metadata/_collections.py +30 -0
  785. package/python/lib/python3.14/importlib/metadata/_functools.py +104 -0
  786. package/python/lib/python3.14/importlib/metadata/_itertools.py +73 -0
  787. package/python/lib/python3.14/importlib/metadata/_meta.py +67 -0
  788. package/python/lib/python3.14/importlib/metadata/_text.py +99 -0
  789. package/python/lib/python3.14/importlib/metadata/diagnose.py +21 -0
  790. package/python/lib/python3.14/importlib/readers.py +12 -0
  791. package/python/lib/python3.14/importlib/resources/__init__.py +43 -0
  792. package/python/lib/python3.14/importlib/resources/__pycache__/__init__.cpython-314.pyc +0 -0
  793. package/python/lib/python3.14/importlib/resources/__pycache__/_adapters.cpython-314.pyc +0 -0
  794. package/python/lib/python3.14/importlib/resources/__pycache__/_common.cpython-314.pyc +0 -0
  795. package/python/lib/python3.14/importlib/resources/__pycache__/_functional.cpython-314.pyc +0 -0
  796. package/python/lib/python3.14/importlib/resources/__pycache__/_itertools.cpython-314.pyc +0 -0
  797. package/python/lib/python3.14/importlib/resources/__pycache__/abc.cpython-314.pyc +0 -0
  798. package/python/lib/python3.14/importlib/resources/__pycache__/readers.cpython-314.pyc +0 -0
  799. package/python/lib/python3.14/importlib/resources/__pycache__/simple.cpython-314.pyc +0 -0
  800. package/python/lib/python3.14/importlib/resources/_adapters.py +168 -0
  801. package/python/lib/python3.14/importlib/resources/_common.py +211 -0
  802. package/python/lib/python3.14/importlib/resources/_functional.py +81 -0
  803. package/python/lib/python3.14/importlib/resources/_itertools.py +38 -0
  804. package/python/lib/python3.14/importlib/resources/abc.py +173 -0
  805. package/python/lib/python3.14/importlib/resources/readers.py +203 -0
  806. package/python/lib/python3.14/importlib/resources/simple.py +106 -0
  807. package/python/lib/python3.14/importlib/simple.py +14 -0
  808. package/python/lib/python3.14/importlib/util.py +279 -0
  809. package/python/lib/python3.14/inspect.py +3425 -0
  810. package/python/lib/python3.14/io.py +150 -0
  811. package/python/lib/python3.14/ipaddress.py +2421 -0
  812. package/python/lib/python3.14/json/__init__.py +365 -0
  813. package/python/lib/python3.14/json/__main__.py +20 -0
  814. package/python/lib/python3.14/json/__pycache__/__init__.cpython-314.pyc +0 -0
  815. package/python/lib/python3.14/json/__pycache__/__main__.cpython-314.pyc +0 -0
  816. package/python/lib/python3.14/json/__pycache__/decoder.cpython-314.pyc +0 -0
  817. package/python/lib/python3.14/json/__pycache__/encoder.cpython-314.pyc +0 -0
  818. package/python/lib/python3.14/json/__pycache__/scanner.cpython-314.pyc +0 -0
  819. package/python/lib/python3.14/json/__pycache__/tool.cpython-314.pyc +0 -0
  820. package/python/lib/python3.14/json/decoder.py +364 -0
  821. package/python/lib/python3.14/json/encoder.py +461 -0
  822. package/python/lib/python3.14/json/scanner.py +73 -0
  823. package/python/lib/python3.14/json/tool.py +122 -0
  824. package/python/lib/python3.14/keyword.py +64 -0
  825. package/python/lib/python3.14/lib-dynload/.empty +0 -0
  826. package/python/lib/python3.14/lib-dynload/_dbm.cpython-314-s390x-linux-gnu.so +0 -0
  827. package/python/lib/python3.14/linecache.py +302 -0
  828. package/python/lib/python3.14/locale.py +1992 -0
  829. package/python/lib/python3.14/logging/__init__.py +2335 -0
  830. package/python/lib/python3.14/logging/__pycache__/__init__.cpython-314.pyc +0 -0
  831. package/python/lib/python3.14/logging/__pycache__/config.cpython-314.pyc +0 -0
  832. package/python/lib/python3.14/logging/__pycache__/handlers.cpython-314.pyc +0 -0
  833. package/python/lib/python3.14/logging/config.py +1093 -0
  834. package/python/lib/python3.14/logging/handlers.py +1654 -0
  835. package/python/lib/python3.14/lzma.py +364 -0
  836. package/python/lib/python3.14/mailbox.py +2220 -0
  837. package/python/lib/python3.14/mimetypes.py +755 -0
  838. package/python/lib/python3.14/modulefinder.py +671 -0
  839. package/python/lib/python3.14/multiprocessing/__init__.py +37 -0
  840. package/python/lib/python3.14/multiprocessing/__pycache__/__init__.cpython-314.pyc +0 -0
  841. package/python/lib/python3.14/multiprocessing/__pycache__/connection.cpython-314.pyc +0 -0
  842. package/python/lib/python3.14/multiprocessing/__pycache__/context.cpython-314.pyc +0 -0
  843. package/python/lib/python3.14/multiprocessing/__pycache__/forkserver.cpython-314.pyc +0 -0
  844. package/python/lib/python3.14/multiprocessing/__pycache__/heap.cpython-314.pyc +0 -0
  845. package/python/lib/python3.14/multiprocessing/__pycache__/managers.cpython-314.pyc +0 -0
  846. package/python/lib/python3.14/multiprocessing/__pycache__/pool.cpython-314.pyc +0 -0
  847. package/python/lib/python3.14/multiprocessing/__pycache__/popen_fork.cpython-314.pyc +0 -0
  848. package/python/lib/python3.14/multiprocessing/__pycache__/popen_forkserver.cpython-314.pyc +0 -0
  849. package/python/lib/python3.14/multiprocessing/__pycache__/popen_spawn_posix.cpython-314.pyc +0 -0
  850. package/python/lib/python3.14/multiprocessing/__pycache__/popen_spawn_win32.cpython-314.pyc +0 -0
  851. package/python/lib/python3.14/multiprocessing/__pycache__/process.cpython-314.pyc +0 -0
  852. package/python/lib/python3.14/multiprocessing/__pycache__/queues.cpython-314.pyc +0 -0
  853. package/python/lib/python3.14/multiprocessing/__pycache__/reduction.cpython-314.pyc +0 -0
  854. package/python/lib/python3.14/multiprocessing/__pycache__/resource_sharer.cpython-314.pyc +0 -0
  855. package/python/lib/python3.14/multiprocessing/__pycache__/resource_tracker.cpython-314.pyc +0 -0
  856. package/python/lib/python3.14/multiprocessing/__pycache__/shared_memory.cpython-314.pyc +0 -0
  857. package/python/lib/python3.14/multiprocessing/__pycache__/sharedctypes.cpython-314.pyc +0 -0
  858. package/python/lib/python3.14/multiprocessing/__pycache__/spawn.cpython-314.pyc +0 -0
  859. package/python/lib/python3.14/multiprocessing/__pycache__/synchronize.cpython-314.pyc +0 -0
  860. package/python/lib/python3.14/multiprocessing/__pycache__/util.cpython-314.pyc +0 -0
  861. package/python/lib/python3.14/multiprocessing/connection.py +1233 -0
  862. package/python/lib/python3.14/multiprocessing/context.py +405 -0
  863. package/python/lib/python3.14/multiprocessing/dummy/__init__.py +126 -0
  864. package/python/lib/python3.14/multiprocessing/dummy/__pycache__/__init__.cpython-314.pyc +0 -0
  865. package/python/lib/python3.14/multiprocessing/dummy/__pycache__/connection.cpython-314.pyc +0 -0
  866. package/python/lib/python3.14/multiprocessing/dummy/connection.py +75 -0
  867. package/python/lib/python3.14/multiprocessing/forkserver.py +429 -0
  868. package/python/lib/python3.14/multiprocessing/heap.py +337 -0
  869. package/python/lib/python3.14/multiprocessing/managers.py +1438 -0
  870. package/python/lib/python3.14/multiprocessing/pool.py +957 -0
  871. package/python/lib/python3.14/multiprocessing/popen_fork.py +100 -0
  872. package/python/lib/python3.14/multiprocessing/popen_forkserver.py +74 -0
  873. package/python/lib/python3.14/multiprocessing/popen_spawn_posix.py +76 -0
  874. package/python/lib/python3.14/multiprocessing/popen_spawn_win32.py +147 -0
  875. package/python/lib/python3.14/multiprocessing/process.py +443 -0
  876. package/python/lib/python3.14/multiprocessing/queues.py +399 -0
  877. package/python/lib/python3.14/multiprocessing/reduction.py +281 -0
  878. package/python/lib/python3.14/multiprocessing/resource_sharer.py +154 -0
  879. package/python/lib/python3.14/multiprocessing/resource_tracker.py +495 -0
  880. package/python/lib/python3.14/multiprocessing/shared_memory.py +544 -0
  881. package/python/lib/python3.14/multiprocessing/sharedctypes.py +240 -0
  882. package/python/lib/python3.14/multiprocessing/spawn.py +307 -0
  883. package/python/lib/python3.14/multiprocessing/synchronize.py +411 -0
  884. package/python/lib/python3.14/multiprocessing/util.py +619 -0
  885. package/python/lib/python3.14/netrc.py +200 -0
  886. package/python/lib/python3.14/ntpath.py +889 -0
  887. package/python/lib/python3.14/nturl2path.py +82 -0
  888. package/python/lib/python3.14/numbers.py +427 -0
  889. package/python/lib/python3.14/opcode.py +122 -0
  890. package/python/lib/python3.14/operator.py +475 -0
  891. package/python/lib/python3.14/optparse.py +1664 -0
  892. package/python/lib/python3.14/os.py +1191 -0
  893. package/python/lib/python3.14/pathlib/__init__.py +1307 -0
  894. package/python/lib/python3.14/pathlib/__pycache__/__init__.cpython-314.pyc +0 -0
  895. package/python/lib/python3.14/pathlib/__pycache__/_local.cpython-314.pyc +0 -0
  896. package/python/lib/python3.14/pathlib/__pycache__/_os.cpython-314.pyc +0 -0
  897. package/python/lib/python3.14/pathlib/__pycache__/types.cpython-314.pyc +0 -0
  898. package/python/lib/python3.14/pathlib/_local.py +12 -0
  899. package/python/lib/python3.14/pathlib/_os.py +530 -0
  900. package/python/lib/python3.14/pathlib/types.py +430 -0
  901. package/python/lib/python3.14/pdb.py +3682 -0
  902. package/python/lib/python3.14/pickle.py +1925 -0
  903. package/python/lib/python3.14/pickletools.py +2887 -0
  904. package/python/lib/python3.14/pkgutil.py +474 -0
  905. package/python/lib/python3.14/platform.py +1515 -0
  906. package/python/lib/python3.14/plistlib.py +956 -0
  907. package/python/lib/python3.14/poplib.py +477 -0
  908. package/python/lib/python3.14/posixpath.py +592 -0
  909. package/python/lib/python3.14/pprint.py +675 -0
  910. package/python/lib/python3.14/profile.py +615 -0
  911. package/python/lib/python3.14/pstats.py +777 -0
  912. package/python/lib/python3.14/pty.py +182 -0
  913. package/python/lib/python3.14/py_compile.py +212 -0
  914. package/python/lib/python3.14/pyclbr.py +314 -0
  915. package/python/lib/python3.14/pydoc.py +2890 -0
  916. package/python/lib/python3.14/queue.py +385 -0
  917. package/python/lib/python3.14/quopri.py +235 -0
  918. package/python/lib/python3.14/random.py +1087 -0
  919. package/python/lib/python3.14/re/__init__.py +428 -0
  920. package/python/lib/python3.14/re/__pycache__/__init__.cpython-314.pyc +0 -0
  921. package/python/lib/python3.14/re/__pycache__/_casefix.cpython-314.pyc +0 -0
  922. package/python/lib/python3.14/re/__pycache__/_compiler.cpython-314.pyc +0 -0
  923. package/python/lib/python3.14/re/__pycache__/_constants.cpython-314.pyc +0 -0
  924. package/python/lib/python3.14/re/__pycache__/_parser.cpython-314.pyc +0 -0
  925. package/python/lib/python3.14/re/_casefix.py +106 -0
  926. package/python/lib/python3.14/re/_compiler.py +782 -0
  927. package/python/lib/python3.14/re/_constants.py +224 -0
  928. package/python/lib/python3.14/re/_parser.py +1066 -0
  929. package/python/lib/python3.14/reprlib.py +230 -0
  930. package/python/lib/python3.14/rlcompleter.py +222 -0
  931. package/python/lib/python3.14/runpy.py +326 -0
  932. package/python/lib/python3.14/sched.py +167 -0
  933. package/python/lib/python3.14/secrets.py +71 -0
  934. package/python/lib/python3.14/selectors.py +603 -0
  935. package/python/lib/python3.14/shelve.py +250 -0
  936. package/python/lib/python3.14/shlex.py +351 -0
  937. package/python/lib/python3.14/shutil.py +1660 -0
  938. package/python/lib/python3.14/signal.py +94 -0
  939. package/python/lib/python3.14/site-packages/_yaml/__init__.py +33 -0
  940. package/python/lib/python3.14/site-packages/_yaml/__pycache__/__init__.cpython-314.pyc +0 -0
  941. package/python/lib/python3.14/site-packages/click/__init__.py +144 -0
  942. package/python/lib/python3.14/site-packages/click/__pycache__/__init__.cpython-314.pyc +0 -0
  943. package/python/lib/python3.14/site-packages/click/__pycache__/_compat.cpython-314.pyc +0 -0
  944. package/python/lib/python3.14/site-packages/click/__pycache__/_termui_impl.cpython-314.pyc +0 -0
  945. package/python/lib/python3.14/site-packages/click/__pycache__/_textwrap.cpython-314.pyc +0 -0
  946. package/python/lib/python3.14/site-packages/click/__pycache__/_utils.cpython-314.pyc +0 -0
  947. package/python/lib/python3.14/site-packages/click/__pycache__/_winconsole.cpython-314.pyc +0 -0
  948. package/python/lib/python3.14/site-packages/click/__pycache__/core.cpython-314.pyc +0 -0
  949. package/python/lib/python3.14/site-packages/click/__pycache__/decorators.cpython-314.pyc +0 -0
  950. package/python/lib/python3.14/site-packages/click/__pycache__/exceptions.cpython-314.pyc +0 -0
  951. package/python/lib/python3.14/site-packages/click/__pycache__/formatting.cpython-314.pyc +0 -0
  952. package/python/lib/python3.14/site-packages/click/__pycache__/globals.cpython-314.pyc +0 -0
  953. package/python/lib/python3.14/site-packages/click/__pycache__/parser.cpython-314.pyc +0 -0
  954. package/python/lib/python3.14/site-packages/click/__pycache__/shell_completion.cpython-314.pyc +0 -0
  955. package/python/lib/python3.14/site-packages/click/__pycache__/termui.cpython-314.pyc +0 -0
  956. package/python/lib/python3.14/site-packages/click/__pycache__/testing.cpython-314.pyc +0 -0
  957. package/python/lib/python3.14/site-packages/click/__pycache__/types.cpython-314.pyc +0 -0
  958. package/python/lib/python3.14/site-packages/click/__pycache__/utils.cpython-314.pyc +0 -0
  959. package/python/lib/python3.14/site-packages/click/_compat.py +590 -0
  960. package/python/lib/python3.14/site-packages/click/_termui_impl.py +970 -0
  961. package/python/lib/python3.14/site-packages/click/_textwrap.py +188 -0
  962. package/python/lib/python3.14/site-packages/click/_utils.py +45 -0
  963. package/python/lib/python3.14/site-packages/click/_winconsole.py +292 -0
  964. package/python/lib/python3.14/site-packages/click/core.py +3825 -0
  965. package/python/lib/python3.14/site-packages/click/decorators.py +625 -0
  966. package/python/lib/python3.14/site-packages/click/exceptions.py +378 -0
  967. package/python/lib/python3.14/site-packages/click/formatting.py +320 -0
  968. package/python/lib/python3.14/site-packages/click/globals.py +67 -0
  969. package/python/lib/python3.14/site-packages/click/parser.py +533 -0
  970. package/python/lib/python3.14/site-packages/click/py.typed +0 -0
  971. package/python/lib/python3.14/site-packages/click/shell_completion.py +796 -0
  972. package/python/lib/python3.14/site-packages/click/termui.py +1024 -0
  973. package/python/lib/python3.14/site-packages/click/testing.py +796 -0
  974. package/python/lib/python3.14/site-packages/click/types.py +1437 -0
  975. package/python/lib/python3.14/site-packages/click/utils.py +676 -0
  976. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/INSTALLER +1 -0
  977. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/METADATA +83 -0
  978. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/RECORD +24 -0
  979. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/REQUESTED +0 -0
  980. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/WHEEL +4 -0
  981. package/python/lib/python3.14/site-packages/click-8.5.1.dist-info/licenses/LICENSE.txt +28 -0
  982. package/python/lib/python3.14/site-packages/cssbeautifier/__init__.py +51 -0
  983. package/python/lib/python3.14/site-packages/cssbeautifier/__pycache__/__init__.cpython-314.pyc +0 -0
  984. package/python/lib/python3.14/site-packages/cssbeautifier/__pycache__/__version__.cpython-314.pyc +0 -0
  985. package/python/lib/python3.14/site-packages/cssbeautifier/__pycache__/_main.cpython-314.pyc +0 -0
  986. package/python/lib/python3.14/site-packages/cssbeautifier/__version__.py +1 -0
  987. package/python/lib/python3.14/site-packages/cssbeautifier/_main.py +208 -0
  988. package/python/lib/python3.14/site-packages/cssbeautifier/css/__init__.py +1 -0
  989. package/python/lib/python3.14/site-packages/cssbeautifier/css/__pycache__/__init__.cpython-314.pyc +0 -0
  990. package/python/lib/python3.14/site-packages/cssbeautifier/css/__pycache__/beautifier.cpython-314.pyc +0 -0
  991. package/python/lib/python3.14/site-packages/cssbeautifier/css/__pycache__/options.cpython-314.pyc +0 -0
  992. package/python/lib/python3.14/site-packages/cssbeautifier/css/beautifier.py +559 -0
  993. package/python/lib/python3.14/site-packages/cssbeautifier/css/options.py +60 -0
  994. package/python/lib/python3.14/site-packages/cssbeautifier/tests/__init__.py +1 -0
  995. package/python/lib/python3.14/site-packages/cssbeautifier/tests/__pycache__/__init__.cpython-314.pyc +0 -0
  996. package/python/lib/python3.14/site-packages/cssbeautifier/tests/generated/__init__.py +1 -0
  997. package/python/lib/python3.14/site-packages/cssbeautifier/tests/generated/__pycache__/__init__.cpython-314.pyc +0 -0
  998. package/python/lib/python3.14/site-packages/cssbeautifier/tests/generated/__pycache__/tests.cpython-314.pyc +0 -0
  999. package/python/lib/python3.14/site-packages/cssbeautifier/tests/generated/tests.py +11333 -0
  1000. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/INSTALLER +1 -0
  1001. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/METADATA +19 -0
  1002. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/RECORD +51 -0
  1003. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/REQUESTED +0 -0
  1004. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/WHEEL +5 -0
  1005. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/entry_points.txt +2 -0
  1006. package/python/lib/python3.14/site-packages/cssbeautifier-2.0.3.dist-info/top_level.txt +1 -0
  1007. package/python/lib/python3.14/site-packages/djlint/__init__.py +27 -0
  1008. package/python/lib/python3.14/site-packages/djlint/__main__.py +8 -0
  1009. package/python/lib/python3.14/site-packages/djlint/__pycache__/__init__.cpython-314.pyc +0 -0
  1010. package/python/lib/python3.14/site-packages/djlint/__pycache__/__main__.cpython-314.pyc +0 -0
  1011. package/python/lib/python3.14/site-packages/djlint/__pycache__/_cli.cpython-314.pyc +0 -0
  1012. package/python/lib/python3.14/site-packages/djlint/__pycache__/api.cpython-314.pyc +0 -0
  1013. package/python/lib/python3.14/site-packages/djlint/__pycache__/const.cpython-314.pyc +0 -0
  1014. package/python/lib/python3.14/site-packages/djlint/__pycache__/github_output.cpython-314.pyc +0 -0
  1015. package/python/lib/python3.14/site-packages/djlint/__pycache__/helpers.cpython-314.pyc +0 -0
  1016. package/python/lib/python3.14/site-packages/djlint/__pycache__/lint.cpython-314.pyc +0 -0
  1017. package/python/lib/python3.14/site-packages/djlint/__pycache__/output.cpython-314.pyc +0 -0
  1018. package/python/lib/python3.14/site-packages/djlint/__pycache__/reformat.cpython-314.pyc +0 -0
  1019. package/python/lib/python3.14/site-packages/djlint/__pycache__/sarif_output.cpython-314.pyc +0 -0
  1020. package/python/lib/python3.14/site-packages/djlint/__pycache__/server.cpython-314.pyc +0 -0
  1021. package/python/lib/python3.14/site-packages/djlint/__pycache__/settings.cpython-314.pyc +0 -0
  1022. package/python/lib/python3.14/site-packages/djlint/__pycache__/src.cpython-314.pyc +0 -0
  1023. package/python/lib/python3.14/site-packages/djlint/_cli.py +1006 -0
  1024. package/python/lib/python3.14/site-packages/djlint/api.py +106 -0
  1025. package/python/lib/python3.14/site-packages/djlint/const.py +506 -0
  1026. package/python/lib/python3.14/site-packages/djlint/formatter/__init__.py +0 -0
  1027. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/__init__.cpython-314.pyc +0 -0
  1028. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/attribute_values.cpython-314.pyc +0 -0
  1029. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/attributes.cpython-314.pyc +0 -0
  1030. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/beautifier.cpython-314.pyc +0 -0
  1031. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/class_attributes.cpython-314.pyc +0 -0
  1032. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/compress.cpython-314.pyc +0 -0
  1033. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/condense.cpython-314.pyc +0 -0
  1034. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/css.cpython-314.pyc +0 -0
  1035. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/endblocks.cpython-314.pyc +0 -0
  1036. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/entities.cpython-314.pyc +0 -0
  1037. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/expand.cpython-314.pyc +0 -0
  1038. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/indent.cpython-314.pyc +0 -0
  1039. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/js.cpython-314.pyc +0 -0
  1040. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/load_tags.cpython-314.pyc +0 -0
  1041. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/mako.cpython-314.pyc +0 -0
  1042. package/python/lib/python3.14/site-packages/djlint/formatter/__pycache__/tokenizer.cpython-314.pyc +0 -0
  1043. package/python/lib/python3.14/site-packages/djlint/formatter/attribute_values.py +152 -0
  1044. package/python/lib/python3.14/site-packages/djlint/formatter/attributes.py +580 -0
  1045. package/python/lib/python3.14/site-packages/djlint/formatter/beautifier.py +144 -0
  1046. package/python/lib/python3.14/site-packages/djlint/formatter/class_attributes.py +318 -0
  1047. package/python/lib/python3.14/site-packages/djlint/formatter/compress.py +158 -0
  1048. package/python/lib/python3.14/site-packages/djlint/formatter/condense.py +503 -0
  1049. package/python/lib/python3.14/site-packages/djlint/formatter/css.py +28 -0
  1050. package/python/lib/python3.14/site-packages/djlint/formatter/endblocks.py +68 -0
  1051. package/python/lib/python3.14/site-packages/djlint/formatter/entities.py +39 -0
  1052. package/python/lib/python3.14/site-packages/djlint/formatter/expand.py +576 -0
  1053. package/python/lib/python3.14/site-packages/djlint/formatter/indent.py +1239 -0
  1054. package/python/lib/python3.14/site-packages/djlint/formatter/js.py +82 -0
  1055. package/python/lib/python3.14/site-packages/djlint/formatter/load_tags.py +60 -0
  1056. package/python/lib/python3.14/site-packages/djlint/formatter/mako.py +501 -0
  1057. package/python/lib/python3.14/site-packages/djlint/formatter/tokenizer.py +359 -0
  1058. package/python/lib/python3.14/site-packages/djlint/github_output.py +117 -0
  1059. package/python/lib/python3.14/site-packages/djlint/helpers.py +979 -0
  1060. package/python/lib/python3.14/site-packages/djlint/lint.py +246 -0
  1061. package/python/lib/python3.14/site-packages/djlint/output.py +250 -0
  1062. package/python/lib/python3.14/site-packages/djlint/py.typed +0 -0
  1063. package/python/lib/python3.14/site-packages/djlint/reformat.py +130 -0
  1064. package/python/lib/python3.14/site-packages/djlint/rules/D058.py +78 -0
  1065. package/python/lib/python3.14/site-packages/djlint/rules/D059.py +139 -0
  1066. package/python/lib/python3.14/site-packages/djlint/rules/H009.py +54 -0
  1067. package/python/lib/python3.14/site-packages/djlint/rules/H012.py +240 -0
  1068. package/python/lib/python3.14/site-packages/djlint/rules/H014.py +68 -0
  1069. package/python/lib/python3.14/site-packages/djlint/rules/H016.py +83 -0
  1070. package/python/lib/python3.14/site-packages/djlint/rules/H022.py +161 -0
  1071. package/python/lib/python3.14/site-packages/djlint/rules/H025.py +141 -0
  1072. package/python/lib/python3.14/site-packages/djlint/rules/H036.py +183 -0
  1073. package/python/lib/python3.14/site-packages/djlint/rules/H037.py +138 -0
  1074. package/python/lib/python3.14/site-packages/djlint/rules/H041.py +113 -0
  1075. package/python/lib/python3.14/site-packages/djlint/rules/H042.py +199 -0
  1076. package/python/lib/python3.14/site-packages/djlint/rules/H044.py +119 -0
  1077. package/python/lib/python3.14/site-packages/djlint/rules/H047.py +118 -0
  1078. package/python/lib/python3.14/site-packages/djlint/rules/H048.py +82 -0
  1079. package/python/lib/python3.14/site-packages/djlint/rules/H051.py +98 -0
  1080. package/python/lib/python3.14/site-packages/djlint/rules/H053.py +361 -0
  1081. package/python/lib/python3.14/site-packages/djlint/rules/H054.py +264 -0
  1082. package/python/lib/python3.14/site-packages/djlint/rules/H057.py +235 -0
  1083. package/python/lib/python3.14/site-packages/djlint/rules/T001.py +103 -0
  1084. package/python/lib/python3.14/site-packages/djlint/rules/T002.py +75 -0
  1085. package/python/lib/python3.14/site-packages/djlint/rules/T003.py +93 -0
  1086. package/python/lib/python3.14/site-packages/djlint/rules/T027.py +183 -0
  1087. package/python/lib/python3.14/site-packages/djlint/rules/T038.py +152 -0
  1088. package/python/lib/python3.14/site-packages/djlint/rules/T039.py +167 -0
  1089. package/python/lib/python3.14/site-packages/djlint/rules/T041.py +307 -0
  1090. package/python/lib/python3.14/site-packages/djlint/rules/T042.py +219 -0
  1091. package/python/lib/python3.14/site-packages/djlint/rules/T043.py +154 -0
  1092. package/python/lib/python3.14/site-packages/djlint/rules/T044.py +189 -0
  1093. package/python/lib/python3.14/site-packages/djlint/rules/T045.py +281 -0
  1094. package/python/lib/python3.14/site-packages/djlint/rules/__init__.py +0 -0
  1095. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/D058.cpython-314.pyc +0 -0
  1096. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/D059.cpython-314.pyc +0 -0
  1097. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H009.cpython-314.pyc +0 -0
  1098. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H012.cpython-314.pyc +0 -0
  1099. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H014.cpython-314.pyc +0 -0
  1100. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H016.cpython-314.pyc +0 -0
  1101. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H022.cpython-314.pyc +0 -0
  1102. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H025.cpython-314.pyc +0 -0
  1103. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H036.cpython-314.pyc +0 -0
  1104. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H037.cpython-314.pyc +0 -0
  1105. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H041.cpython-314.pyc +0 -0
  1106. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H042.cpython-314.pyc +0 -0
  1107. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H044.cpython-314.pyc +0 -0
  1108. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H047.cpython-314.pyc +0 -0
  1109. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H048.cpython-314.pyc +0 -0
  1110. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H051.cpython-314.pyc +0 -0
  1111. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H053.cpython-314.pyc +0 -0
  1112. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H054.cpython-314.pyc +0 -0
  1113. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/H057.cpython-314.pyc +0 -0
  1114. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T001.cpython-314.pyc +0 -0
  1115. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T002.cpython-314.pyc +0 -0
  1116. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T003.cpython-314.pyc +0 -0
  1117. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T027.cpython-314.pyc +0 -0
  1118. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T038.cpython-314.pyc +0 -0
  1119. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T039.cpython-314.pyc +0 -0
  1120. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T041.cpython-314.pyc +0 -0
  1121. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T042.cpython-314.pyc +0 -0
  1122. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T043.cpython-314.pyc +0 -0
  1123. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T044.cpython-314.pyc +0 -0
  1124. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/T045.cpython-314.pyc +0 -0
  1125. package/python/lib/python3.14/site-packages/djlint/rules/__pycache__/__init__.cpython-314.pyc +0 -0
  1126. package/python/lib/python3.14/site-packages/djlint/rules.yaml +482 -0
  1127. package/python/lib/python3.14/site-packages/djlint/sarif_output.py +171 -0
  1128. package/python/lib/python3.14/site-packages/djlint/server.py +983 -0
  1129. package/python/lib/python3.14/site-packages/djlint/settings.py +2381 -0
  1130. package/python/lib/python3.14/site-packages/djlint/src.py +192 -0
  1131. package/python/lib/python3.14/site-packages/djlint/types.pyi +20 -0
  1132. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/INSTALLER +1 -0
  1133. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/METADATA +236 -0
  1134. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/RECORD +73 -0
  1135. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/REQUESTED +0 -0
  1136. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/WHEEL +4 -0
  1137. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/entry_points.txt +2 -0
  1138. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/licenses/LICENSE +675 -0
  1139. package/python/lib/python3.14/site-packages/djlint-1.54.0.dist-info/licenses/LICENSE-THIRD-PARTY +271 -0
  1140. package/python/lib/python3.14/site-packages/editorconfig/__init__.py +20 -0
  1141. package/python/lib/python3.14/site-packages/editorconfig/__main__.py +83 -0
  1142. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/__init__.cpython-314.pyc +0 -0
  1143. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/__main__.cpython-314.pyc +0 -0
  1144. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/exceptions.cpython-314.pyc +0 -0
  1145. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/fnmatch.cpython-314.pyc +0 -0
  1146. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/handler.cpython-314.pyc +0 -0
  1147. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/ini.cpython-314.pyc +0 -0
  1148. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/version.cpython-314.pyc +0 -0
  1149. package/python/lib/python3.14/site-packages/editorconfig/__pycache__/versiontools.cpython-314.pyc +0 -0
  1150. package/python/lib/python3.14/site-packages/editorconfig/exceptions.py +24 -0
  1151. package/python/lib/python3.14/site-packages/editorconfig/fnmatch.py +224 -0
  1152. package/python/lib/python3.14/site-packages/editorconfig/handler.py +128 -0
  1153. package/python/lib/python3.14/site-packages/editorconfig/ini.py +173 -0
  1154. package/python/lib/python3.14/site-packages/editorconfig/py.typed +0 -0
  1155. package/python/lib/python3.14/site-packages/editorconfig/version.py +1 -0
  1156. package/python/lib/python3.14/site-packages/editorconfig/versiontools.py +36 -0
  1157. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/INSTALLER +1 -0
  1158. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/METADATA +116 -0
  1159. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/RECORD +20 -0
  1160. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/REQUESTED +0 -0
  1161. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/WHEEL +5 -0
  1162. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/entry_points.txt +2 -0
  1163. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/licenses/COPYING +11 -0
  1164. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/licenses/LICENSE.BSD +22 -0
  1165. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/licenses/LICENSE.PSF +192 -0
  1166. package/python/lib/python3.14/site-packages/editorconfig-0.17.1.dist-info/top_level.txt +1 -0
  1167. package/python/lib/python3.14/site-packages/jsbeautifier/__init__.py +309 -0
  1168. package/python/lib/python3.14/site-packages/jsbeautifier/__pycache__/__init__.cpython-314.pyc +0 -0
  1169. package/python/lib/python3.14/site-packages/jsbeautifier/__pycache__/__version__.cpython-314.pyc +0 -0
  1170. package/python/lib/python3.14/site-packages/jsbeautifier/__version__.py +1 -0
  1171. package/python/lib/python3.14/site-packages/jsbeautifier/cli/__init__.py +210 -0
  1172. package/python/lib/python3.14/site-packages/jsbeautifier/cli/__pycache__/__init__.cpython-314.pyc +0 -0
  1173. package/python/lib/python3.14/site-packages/jsbeautifier/core/__init__.py +1 -0
  1174. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/__init__.cpython-314.pyc +0 -0
  1175. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/directives.cpython-314.pyc +0 -0
  1176. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/inputscanner.cpython-314.pyc +0 -0
  1177. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/options.cpython-314.pyc +0 -0
  1178. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/output.cpython-314.pyc +0 -0
  1179. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/pattern.cpython-314.pyc +0 -0
  1180. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/templatablepattern.cpython-314.pyc +0 -0
  1181. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/token.cpython-314.pyc +0 -0
  1182. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/tokenizer.cpython-314.pyc +0 -0
  1183. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/tokenstream.cpython-314.pyc +0 -0
  1184. package/python/lib/python3.14/site-packages/jsbeautifier/core/__pycache__/whitespacepattern.cpython-314.pyc +0 -0
  1185. package/python/lib/python3.14/site-packages/jsbeautifier/core/directives.py +55 -0
  1186. package/python/lib/python3.14/site-packages/jsbeautifier/core/inputscanner.py +139 -0
  1187. package/python/lib/python3.14/site-packages/jsbeautifier/core/options.py +230 -0
  1188. package/python/lib/python3.14/site-packages/jsbeautifier/core/output.py +352 -0
  1189. package/python/lib/python3.14/site-packages/jsbeautifier/core/pattern.py +83 -0
  1190. package/python/lib/python3.14/site-packages/jsbeautifier/core/templatablepattern.py +192 -0
  1191. package/python/lib/python3.14/site-packages/jsbeautifier/core/token.py +38 -0
  1192. package/python/lib/python3.14/site-packages/jsbeautifier/core/tokenizer.py +138 -0
  1193. package/python/lib/python3.14/site-packages/jsbeautifier/core/tokenstream.py +74 -0
  1194. package/python/lib/python3.14/site-packages/jsbeautifier/core/whitespacepattern.py +73 -0
  1195. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__init__.py +1 -0
  1196. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__pycache__/__init__.cpython-314.pyc +0 -0
  1197. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__pycache__/acorn.cpython-314.pyc +0 -0
  1198. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__pycache__/beautifier.cpython-314.pyc +0 -0
  1199. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__pycache__/options.cpython-314.pyc +0 -0
  1200. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/__pycache__/tokenizer.cpython-314.pyc +0 -0
  1201. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/acorn.py +81 -0
  1202. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/beautifier.py +1647 -0
  1203. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/options.py +102 -0
  1204. package/python/lib/python3.14/site-packages/jsbeautifier/javascript/tokenizer.py +628 -0
  1205. package/python/lib/python3.14/site-packages/jsbeautifier/tests/__init__.py +1 -0
  1206. package/python/lib/python3.14/site-packages/jsbeautifier/tests/__pycache__/__init__.cpython-314.pyc +0 -0
  1207. package/python/lib/python3.14/site-packages/jsbeautifier/tests/__pycache__/testindentation.cpython-314.pyc +0 -0
  1208. package/python/lib/python3.14/site-packages/jsbeautifier/tests/generated/__init__.py +1 -0
  1209. package/python/lib/python3.14/site-packages/jsbeautifier/tests/generated/__pycache__/__init__.cpython-314.pyc +0 -0
  1210. package/python/lib/python3.14/site-packages/jsbeautifier/tests/generated/__pycache__/tests.cpython-314.pyc +0 -0
  1211. package/python/lib/python3.14/site-packages/jsbeautifier/tests/generated/tests.py +10470 -0
  1212. package/python/lib/python3.14/site-packages/jsbeautifier/tests/testindentation.py +49 -0
  1213. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__init__.py +73 -0
  1214. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/__init__.cpython-314.pyc +0 -0
  1215. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/evalbased.cpython-314.pyc +0 -0
  1216. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/javascriptobfuscator.cpython-314.pyc +0 -0
  1217. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/myobfuscate.cpython-314.pyc +0 -0
  1218. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/packer.cpython-314.pyc +0 -0
  1219. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/__pycache__/urlencode.cpython-314.pyc +0 -0
  1220. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/evalbased.py +44 -0
  1221. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/javascriptobfuscator.py +61 -0
  1222. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/myobfuscate.py +83 -0
  1223. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/packer.py +158 -0
  1224. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__init__.py +2 -0
  1225. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__pycache__/__init__.cpython-314.pyc +0 -0
  1226. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__pycache__/testjavascriptobfuscator.cpython-314.pyc +0 -0
  1227. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__pycache__/testmyobfuscate.cpython-314.pyc +0 -0
  1228. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__pycache__/testpacker.cpython-314.pyc +0 -0
  1229. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/__pycache__/testurlencode.cpython-314.pyc +0 -0
  1230. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/testjavascriptobfuscator.py +59 -0
  1231. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/testmyobfuscate.py +48 -0
  1232. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/testpacker.py +72 -0
  1233. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/tests/testurlencode.py +46 -0
  1234. package/python/lib/python3.14/site-packages/jsbeautifier/unpackers/urlencode.py +32 -0
  1235. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/INSTALLER +1 -0
  1236. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/METADATA +18 -0
  1237. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/RECORD +42 -0
  1238. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/REQUESTED +0 -0
  1239. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/WHEEL +5 -0
  1240. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/entry_points.txt +2 -0
  1241. package/python/lib/python3.14/site-packages/jsbeautifier-2.0.3.dist-info/top_level.txt +1 -0
  1242. package/python/lib/python3.14/site-packages/json5/__init__.py +30 -0
  1243. package/python/lib/python3.14/site-packages/json5/__main__.py +22 -0
  1244. package/python/lib/python3.14/site-packages/json5/__pycache__/__init__.cpython-314.pyc +0 -0
  1245. package/python/lib/python3.14/site-packages/json5/__pycache__/__main__.cpython-314.pyc +0 -0
  1246. package/python/lib/python3.14/site-packages/json5/__pycache__/host.cpython-314.pyc +0 -0
  1247. package/python/lib/python3.14/site-packages/json5/__pycache__/lib.cpython-314.pyc +0 -0
  1248. package/python/lib/python3.14/site-packages/json5/__pycache__/parser.cpython-314.pyc +0 -0
  1249. package/python/lib/python3.14/site-packages/json5/__pycache__/tool.cpython-314.pyc +0 -0
  1250. package/python/lib/python3.14/site-packages/json5/__pycache__/version.cpython-314.pyc +0 -0
  1251. package/python/lib/python3.14/site-packages/json5/host.py +53 -0
  1252. package/python/lib/python3.14/site-packages/json5/lib.py +1007 -0
  1253. package/python/lib/python3.14/site-packages/json5/parser.py +1376 -0
  1254. package/python/lib/python3.14/site-packages/json5/py.typed +0 -0
  1255. package/python/lib/python3.14/site-packages/json5/tool.py +198 -0
  1256. package/python/lib/python3.14/site-packages/json5/version.py +18 -0
  1257. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/INSTALLER +1 -0
  1258. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/METADATA +585 -0
  1259. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/RECORD +17 -0
  1260. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/REQUESTED +0 -0
  1261. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/WHEEL +5 -0
  1262. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/entry_points.txt +2 -0
  1263. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/licenses/LICENSE +281 -0
  1264. package/python/lib/python3.14/site-packages/json5-0.17.3.dist-info/top_level.txt +1 -0
  1265. package/python/lib/python3.14/site-packages/pathspec/__init__.py +68 -0
  1266. package/python/lib/python3.14/site-packages/pathspec/__pycache__/__init__.cpython-314.pyc +0 -0
  1267. package/python/lib/python3.14/site-packages/pathspec/__pycache__/_meta.cpython-314.pyc +0 -0
  1268. package/python/lib/python3.14/site-packages/pathspec/__pycache__/_typing.cpython-314.pyc +0 -0
  1269. package/python/lib/python3.14/site-packages/pathspec/__pycache__/_version.cpython-314.pyc +0 -0
  1270. package/python/lib/python3.14/site-packages/pathspec/__pycache__/backend.cpython-314.pyc +0 -0
  1271. package/python/lib/python3.14/site-packages/pathspec/__pycache__/gitignore.cpython-314.pyc +0 -0
  1272. package/python/lib/python3.14/site-packages/pathspec/__pycache__/pathspec.cpython-314.pyc +0 -0
  1273. package/python/lib/python3.14/site-packages/pathspec/__pycache__/pattern.cpython-314.pyc +0 -0
  1274. package/python/lib/python3.14/site-packages/pathspec/__pycache__/util.cpython-314.pyc +0 -0
  1275. package/python/lib/python3.14/site-packages/pathspec/_backends/__init__.py +4 -0
  1276. package/python/lib/python3.14/site-packages/pathspec/_backends/__pycache__/__init__.cpython-314.pyc +0 -0
  1277. package/python/lib/python3.14/site-packages/pathspec/_backends/__pycache__/_utils.cpython-314.pyc +0 -0
  1278. package/python/lib/python3.14/site-packages/pathspec/_backends/__pycache__/agg.cpython-314.pyc +0 -0
  1279. package/python/lib/python3.14/site-packages/pathspec/_backends/_utils.py +45 -0
  1280. package/python/lib/python3.14/site-packages/pathspec/_backends/agg.py +104 -0
  1281. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__init__.py +0 -0
  1282. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__pycache__/__init__.cpython-314.pyc +0 -0
  1283. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__pycache__/_base.cpython-314.pyc +0 -0
  1284. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__pycache__/base.cpython-314.pyc +0 -0
  1285. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__pycache__/gitignore.cpython-314.pyc +0 -0
  1286. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/__pycache__/pathspec.cpython-314.pyc +0 -0
  1287. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/_base.py +78 -0
  1288. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/base.py +24 -0
  1289. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/gitignore.py +250 -0
  1290. package/python/lib/python3.14/site-packages/pathspec/_backends/hyperscan/pathspec.py +257 -0
  1291. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__init__.py +0 -0
  1292. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__pycache__/__init__.cpython-314.pyc +0 -0
  1293. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__pycache__/_base.cpython-314.pyc +0 -0
  1294. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__pycache__/base.cpython-314.pyc +0 -0
  1295. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__pycache__/gitignore.cpython-314.pyc +0 -0
  1296. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/__pycache__/pathspec.cpython-314.pyc +0 -0
  1297. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/_base.py +95 -0
  1298. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/base.py +18 -0
  1299. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/gitignore.py +180 -0
  1300. package/python/lib/python3.14/site-packages/pathspec/_backends/re2/pathspec.py +189 -0
  1301. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/__init__.py +0 -0
  1302. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/__pycache__/__init__.cpython-314.pyc +0 -0
  1303. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/__pycache__/gitignore.cpython-314.pyc +0 -0
  1304. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/__pycache__/pathspec.cpython-314.pyc +0 -0
  1305. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/gitignore.py +104 -0
  1306. package/python/lib/python3.14/site-packages/pathspec/_backends/simple/pathspec.py +76 -0
  1307. package/python/lib/python3.14/site-packages/pathspec/_meta.py +70 -0
  1308. package/python/lib/python3.14/site-packages/pathspec/_typing.py +64 -0
  1309. package/python/lib/python3.14/site-packages/pathspec/_version.py +5 -0
  1310. package/python/lib/python3.14/site-packages/pathspec/backend.py +51 -0
  1311. package/python/lib/python3.14/site-packages/pathspec/gitignore.py +172 -0
  1312. package/python/lib/python3.14/site-packages/pathspec/pathspec.py +527 -0
  1313. package/python/lib/python3.14/site-packages/pathspec/pattern.py +259 -0
  1314. package/python/lib/python3.14/site-packages/pathspec/patterns/__init__.py +12 -0
  1315. package/python/lib/python3.14/site-packages/pathspec/patterns/__pycache__/__init__.cpython-314.pyc +0 -0
  1316. package/python/lib/python3.14/site-packages/pathspec/patterns/__pycache__/gitwildmatch.cpython-314.pyc +0 -0
  1317. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/__init__.py +17 -0
  1318. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/__pycache__/__init__.cpython-314.pyc +0 -0
  1319. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/__pycache__/base.cpython-314.pyc +0 -0
  1320. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/__pycache__/basic.cpython-314.pyc +0 -0
  1321. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/__pycache__/spec.cpython-314.pyc +0 -0
  1322. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/base.py +210 -0
  1323. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/basic.py +320 -0
  1324. package/python/lib/python3.14/site-packages/pathspec/patterns/gitignore/spec.py +344 -0
  1325. package/python/lib/python3.14/site-packages/pathspec/patterns/gitwildmatch.py +52 -0
  1326. package/python/lib/python3.14/site-packages/pathspec/py.typed +1 -0
  1327. package/python/lib/python3.14/site-packages/pathspec/util.py +864 -0
  1328. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/INSTALLER +1 -0
  1329. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/METADATA +392 -0
  1330. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/RECORD +38 -0
  1331. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/REQUESTED +0 -0
  1332. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/WHEEL +4 -0
  1333. package/python/lib/python3.14/site-packages/pathspec-1.1.1.dist-info/licenses/LICENSE +373 -0
  1334. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/INSTALLER +1 -0
  1335. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/METADATA +59 -0
  1336. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/RECORD +26 -0
  1337. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/REQUESTED +0 -0
  1338. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/WHEEL +7 -0
  1339. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/licenses/LICENSE +20 -0
  1340. package/python/lib/python3.14/site-packages/pyyaml-6.0.3.dist-info/top_level.txt +2 -0
  1341. package/python/lib/python3.14/site-packages/regex/__init__.py +3 -0
  1342. package/python/lib/python3.14/site-packages/regex/__pycache__/__init__.cpython-314.pyc +0 -0
  1343. package/python/lib/python3.14/site-packages/regex/__pycache__/_main.cpython-314.pyc +0 -0
  1344. package/python/lib/python3.14/site-packages/regex/__pycache__/_regex_core.cpython-314.pyc +0 -0
  1345. package/python/lib/python3.14/site-packages/regex/_main.py +759 -0
  1346. package/python/lib/python3.14/site-packages/regex/_regex.cpython-314-s390x-linux-gnu.so +0 -0
  1347. package/python/lib/python3.14/site-packages/regex/_regex_core.py +4689 -0
  1348. package/python/lib/python3.14/site-packages/regex/tests/__pycache__/test_regex.cpython-314.pyc +0 -0
  1349. package/python/lib/python3.14/site-packages/regex/tests/test_regex.py +4557 -0
  1350. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/INSTALLER +1 -0
  1351. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/METADATA +1060 -0
  1352. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/RECORD +12 -0
  1353. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/REQUESTED +0 -0
  1354. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/WHEEL +7 -0
  1355. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/licenses/LICENSE.txt +208 -0
  1356. package/python/lib/python3.14/site-packages/regex-2026.11.9.dist-info/top_level.txt +1 -0
  1357. package/python/lib/python3.14/site-packages/yaml/__init__.py +390 -0
  1358. package/python/lib/python3.14/site-packages/yaml/__pycache__/__init__.cpython-314.pyc +0 -0
  1359. package/python/lib/python3.14/site-packages/yaml/__pycache__/composer.cpython-314.pyc +0 -0
  1360. package/python/lib/python3.14/site-packages/yaml/__pycache__/constructor.cpython-314.pyc +0 -0
  1361. package/python/lib/python3.14/site-packages/yaml/__pycache__/cyaml.cpython-314.pyc +0 -0
  1362. package/python/lib/python3.14/site-packages/yaml/__pycache__/dumper.cpython-314.pyc +0 -0
  1363. package/python/lib/python3.14/site-packages/yaml/__pycache__/emitter.cpython-314.pyc +0 -0
  1364. package/python/lib/python3.14/site-packages/yaml/__pycache__/error.cpython-314.pyc +0 -0
  1365. package/python/lib/python3.14/site-packages/yaml/__pycache__/events.cpython-314.pyc +0 -0
  1366. package/python/lib/python3.14/site-packages/yaml/__pycache__/loader.cpython-314.pyc +0 -0
  1367. package/python/lib/python3.14/site-packages/yaml/__pycache__/nodes.cpython-314.pyc +0 -0
  1368. package/python/lib/python3.14/site-packages/yaml/__pycache__/parser.cpython-314.pyc +0 -0
  1369. package/python/lib/python3.14/site-packages/yaml/__pycache__/reader.cpython-314.pyc +0 -0
  1370. package/python/lib/python3.14/site-packages/yaml/__pycache__/representer.cpython-314.pyc +0 -0
  1371. package/python/lib/python3.14/site-packages/yaml/__pycache__/resolver.cpython-314.pyc +0 -0
  1372. package/python/lib/python3.14/site-packages/yaml/__pycache__/scanner.cpython-314.pyc +0 -0
  1373. package/python/lib/python3.14/site-packages/yaml/__pycache__/serializer.cpython-314.pyc +0 -0
  1374. package/python/lib/python3.14/site-packages/yaml/__pycache__/tokens.cpython-314.pyc +0 -0
  1375. package/python/lib/python3.14/site-packages/yaml/_yaml.cpython-314-s390x-linux-gnu.so +0 -0
  1376. package/python/lib/python3.14/site-packages/yaml/composer.py +139 -0
  1377. package/python/lib/python3.14/site-packages/yaml/constructor.py +748 -0
  1378. package/python/lib/python3.14/site-packages/yaml/cyaml.py +101 -0
  1379. package/python/lib/python3.14/site-packages/yaml/dumper.py +62 -0
  1380. package/python/lib/python3.14/site-packages/yaml/emitter.py +1137 -0
  1381. package/python/lib/python3.14/site-packages/yaml/error.py +75 -0
  1382. package/python/lib/python3.14/site-packages/yaml/events.py +86 -0
  1383. package/python/lib/python3.14/site-packages/yaml/loader.py +63 -0
  1384. package/python/lib/python3.14/site-packages/yaml/nodes.py +49 -0
  1385. package/python/lib/python3.14/site-packages/yaml/parser.py +589 -0
  1386. package/python/lib/python3.14/site-packages/yaml/reader.py +185 -0
  1387. package/python/lib/python3.14/site-packages/yaml/representer.py +389 -0
  1388. package/python/lib/python3.14/site-packages/yaml/resolver.py +227 -0
  1389. package/python/lib/python3.14/site-packages/yaml/scanner.py +1435 -0
  1390. package/python/lib/python3.14/site-packages/yaml/serializer.py +111 -0
  1391. package/python/lib/python3.14/site-packages/yaml/tokens.py +104 -0
  1392. package/python/lib/python3.14/site.py +779 -0
  1393. package/python/lib/python3.14/smtplib.py +1121 -0
  1394. package/python/lib/python3.14/socket.py +994 -0
  1395. package/python/lib/python3.14/socketserver.py +863 -0
  1396. package/python/lib/python3.14/sqlite3/__init__.py +57 -0
  1397. package/python/lib/python3.14/sqlite3/__main__.py +139 -0
  1398. package/python/lib/python3.14/sqlite3/__pycache__/__init__.cpython-314.pyc +0 -0
  1399. package/python/lib/python3.14/sqlite3/__pycache__/__main__.cpython-314.pyc +0 -0
  1400. package/python/lib/python3.14/sqlite3/__pycache__/dbapi2.cpython-314.pyc +0 -0
  1401. package/python/lib/python3.14/sqlite3/__pycache__/dump.cpython-314.pyc +0 -0
  1402. package/python/lib/python3.14/sqlite3/dbapi2.py +96 -0
  1403. package/python/lib/python3.14/sqlite3/dump.py +118 -0
  1404. package/python/lib/python3.14/sre_compile.py +7 -0
  1405. package/python/lib/python3.14/sre_constants.py +7 -0
  1406. package/python/lib/python3.14/sre_parse.py +7 -0
  1407. package/python/lib/python3.14/ssl.py +1552 -0
  1408. package/python/lib/python3.14/stat.py +212 -0
  1409. package/python/lib/python3.14/statistics.py +1879 -0
  1410. package/python/lib/python3.14/string/__init__.py +332 -0
  1411. package/python/lib/python3.14/string/__pycache__/__init__.cpython-314.pyc +0 -0
  1412. package/python/lib/python3.14/string/__pycache__/templatelib.cpython-314.pyc +0 -0
  1413. package/python/lib/python3.14/string/templatelib.py +33 -0
  1414. package/python/lib/python3.14/stringprep.py +456 -0
  1415. package/python/lib/python3.14/struct.py +15 -0
  1416. package/python/lib/python3.14/subprocess.py +2257 -0
  1417. package/python/lib/python3.14/symtable.py +451 -0
  1418. package/python/lib/python3.14/sysconfig/__init__.py +798 -0
  1419. package/python/lib/python3.14/sysconfig/__main__.py +276 -0
  1420. package/python/lib/python3.14/sysconfig/__pycache__/__init__.cpython-314.pyc +0 -0
  1421. package/python/lib/python3.14/sysconfig/__pycache__/__main__.cpython-314.pyc +0 -0
  1422. package/python/lib/python3.14/tabnanny.py +338 -0
  1423. package/python/lib/python3.14/tarfile.py +3228 -0
  1424. package/python/lib/python3.14/tempfile.py +1057 -0
  1425. package/python/lib/python3.14/textwrap.py +475 -0
  1426. package/python/lib/python3.14/this.py +28 -0
  1427. package/python/lib/python3.14/threading.py +1643 -0
  1428. package/python/lib/python3.14/timeit.py +378 -0
  1429. package/python/lib/python3.14/token.py +144 -0
  1430. package/python/lib/python3.14/tokenize.py +598 -0
  1431. package/python/lib/python3.14/tomllib/__init__.py +10 -0
  1432. package/python/lib/python3.14/tomllib/__pycache__/__init__.cpython-314.pyc +0 -0
  1433. package/python/lib/python3.14/tomllib/__pycache__/_parser.cpython-314.pyc +0 -0
  1434. package/python/lib/python3.14/tomllib/__pycache__/_re.cpython-314.pyc +0 -0
  1435. package/python/lib/python3.14/tomllib/__pycache__/_types.cpython-314.pyc +0 -0
  1436. package/python/lib/python3.14/tomllib/_parser.py +765 -0
  1437. package/python/lib/python3.14/tomllib/_re.py +113 -0
  1438. package/python/lib/python3.14/tomllib/_types.py +10 -0
  1439. package/python/lib/python3.14/tomllib/mypy.ini +15 -0
  1440. package/python/lib/python3.14/trace.py +751 -0
  1441. package/python/lib/python3.14/traceback.py +1751 -0
  1442. package/python/lib/python3.14/tracemalloc.py +560 -0
  1443. package/python/lib/python3.14/tty.py +73 -0
  1444. package/python/lib/python3.14/types.py +345 -0
  1445. package/python/lib/python3.14/typing.py +3866 -0
  1446. package/python/lib/python3.14/unittest/__init__.py +80 -0
  1447. package/python/lib/python3.14/unittest/__main__.py +18 -0
  1448. package/python/lib/python3.14/unittest/__pycache__/__init__.cpython-314.pyc +0 -0
  1449. package/python/lib/python3.14/unittest/__pycache__/__main__.cpython-314.pyc +0 -0
  1450. package/python/lib/python3.14/unittest/__pycache__/_log.cpython-314.pyc +0 -0
  1451. package/python/lib/python3.14/unittest/__pycache__/async_case.cpython-314.pyc +0 -0
  1452. package/python/lib/python3.14/unittest/__pycache__/case.cpython-314.pyc +0 -0
  1453. package/python/lib/python3.14/unittest/__pycache__/loader.cpython-314.pyc +0 -0
  1454. package/python/lib/python3.14/unittest/__pycache__/main.cpython-314.pyc +0 -0
  1455. package/python/lib/python3.14/unittest/__pycache__/mock.cpython-314.pyc +0 -0
  1456. package/python/lib/python3.14/unittest/__pycache__/result.cpython-314.pyc +0 -0
  1457. package/python/lib/python3.14/unittest/__pycache__/runner.cpython-314.pyc +0 -0
  1458. package/python/lib/python3.14/unittest/__pycache__/signals.cpython-314.pyc +0 -0
  1459. package/python/lib/python3.14/unittest/__pycache__/suite.cpython-314.pyc +0 -0
  1460. package/python/lib/python3.14/unittest/__pycache__/util.cpython-314.pyc +0 -0
  1461. package/python/lib/python3.14/unittest/_log.py +86 -0
  1462. package/python/lib/python3.14/unittest/async_case.py +158 -0
  1463. package/python/lib/python3.14/unittest/case.py +1628 -0
  1464. package/python/lib/python3.14/unittest/loader.py +491 -0
  1465. package/python/lib/python3.14/unittest/main.py +280 -0
  1466. package/python/lib/python3.14/unittest/mock.py +3208 -0
  1467. package/python/lib/python3.14/unittest/result.py +259 -0
  1468. package/python/lib/python3.14/unittest/runner.py +313 -0
  1469. package/python/lib/python3.14/unittest/signals.py +71 -0
  1470. package/python/lib/python3.14/unittest/suite.py +379 -0
  1471. package/python/lib/python3.14/unittest/util.py +170 -0
  1472. package/python/lib/python3.14/urllib/__init__.py +0 -0
  1473. package/python/lib/python3.14/urllib/__pycache__/__init__.cpython-314.pyc +0 -0
  1474. package/python/lib/python3.14/urllib/__pycache__/error.cpython-314.pyc +0 -0
  1475. package/python/lib/python3.14/urllib/__pycache__/parse.cpython-314.pyc +0 -0
  1476. package/python/lib/python3.14/urllib/__pycache__/request.cpython-314.pyc +0 -0
  1477. package/python/lib/python3.14/urllib/__pycache__/response.cpython-314.pyc +0 -0
  1478. package/python/lib/python3.14/urllib/__pycache__/robotparser.cpython-314.pyc +0 -0
  1479. package/python/lib/python3.14/urllib/error.py +74 -0
  1480. package/python/lib/python3.14/urllib/parse.py +1289 -0
  1481. package/python/lib/python3.14/urllib/request.py +2175 -0
  1482. package/python/lib/python3.14/urllib/response.py +84 -0
  1483. package/python/lib/python3.14/urllib/robotparser.py +363 -0
  1484. package/python/lib/python3.14/uuid.py +1013 -0
  1485. package/python/lib/python3.14/venv/__init__.py +700 -0
  1486. package/python/lib/python3.14/venv/__main__.py +10 -0
  1487. package/python/lib/python3.14/venv/__pycache__/__init__.cpython-314.pyc +0 -0
  1488. package/python/lib/python3.14/venv/__pycache__/__main__.cpython-314.pyc +0 -0
  1489. package/python/lib/python3.14/venv/scripts/common/Activate.ps1 +248 -0
  1490. package/python/lib/python3.14/venv/scripts/common/activate +76 -0
  1491. package/python/lib/python3.14/venv/scripts/common/activate.fish +69 -0
  1492. package/python/lib/python3.14/venv/scripts/posix/activate.csh +29 -0
  1493. package/python/lib/python3.14/warnings.py +99 -0
  1494. package/python/lib/python3.14/wave.py +665 -0
  1495. package/python/lib/python3.14/weakref.py +574 -0
  1496. package/python/lib/python3.14/webbrowser.py +763 -0
  1497. package/python/lib/python3.14/wsgiref/__init__.py +25 -0
  1498. package/python/lib/python3.14/wsgiref/__pycache__/__init__.cpython-314.pyc +0 -0
  1499. package/python/lib/python3.14/wsgiref/__pycache__/handlers.cpython-314.pyc +0 -0
  1500. package/python/lib/python3.14/wsgiref/__pycache__/headers.cpython-314.pyc +0 -0
  1501. package/python/lib/python3.14/wsgiref/__pycache__/simple_server.cpython-314.pyc +0 -0
  1502. package/python/lib/python3.14/wsgiref/__pycache__/types.cpython-314.pyc +0 -0
  1503. package/python/lib/python3.14/wsgiref/__pycache__/util.cpython-314.pyc +0 -0
  1504. package/python/lib/python3.14/wsgiref/__pycache__/validate.cpython-314.pyc +0 -0
  1505. package/python/lib/python3.14/wsgiref/handlers.py +575 -0
  1506. package/python/lib/python3.14/wsgiref/headers.py +192 -0
  1507. package/python/lib/python3.14/wsgiref/simple_server.py +161 -0
  1508. package/python/lib/python3.14/wsgiref/types.py +54 -0
  1509. package/python/lib/python3.14/wsgiref/util.py +159 -0
  1510. package/python/lib/python3.14/wsgiref/validate.py +438 -0
  1511. package/python/lib/python3.14/xml/__init__.py +20 -0
  1512. package/python/lib/python3.14/xml/__pycache__/__init__.cpython-314.pyc +0 -0
  1513. package/python/lib/python3.14/xml/dom/NodeFilter.py +27 -0
  1514. package/python/lib/python3.14/xml/dom/__init__.py +140 -0
  1515. package/python/lib/python3.14/xml/dom/__pycache__/NodeFilter.cpython-314.pyc +0 -0
  1516. package/python/lib/python3.14/xml/dom/__pycache__/__init__.cpython-314.pyc +0 -0
  1517. package/python/lib/python3.14/xml/dom/__pycache__/domreg.cpython-314.pyc +0 -0
  1518. package/python/lib/python3.14/xml/dom/__pycache__/expatbuilder.cpython-314.pyc +0 -0
  1519. package/python/lib/python3.14/xml/dom/__pycache__/minicompat.cpython-314.pyc +0 -0
  1520. package/python/lib/python3.14/xml/dom/__pycache__/minidom.cpython-314.pyc +0 -0
  1521. package/python/lib/python3.14/xml/dom/__pycache__/pulldom.cpython-314.pyc +0 -0
  1522. package/python/lib/python3.14/xml/dom/__pycache__/xmlbuilder.cpython-314.pyc +0 -0
  1523. package/python/lib/python3.14/xml/dom/domreg.py +99 -0
  1524. package/python/lib/python3.14/xml/dom/expatbuilder.py +964 -0
  1525. package/python/lib/python3.14/xml/dom/minicompat.py +109 -0
  1526. package/python/lib/python3.14/xml/dom/minidom.py +2027 -0
  1527. package/python/lib/python3.14/xml/dom/pulldom.py +350 -0
  1528. package/python/lib/python3.14/xml/dom/xmlbuilder.py +389 -0
  1529. package/python/lib/python3.14/xml/etree/ElementInclude.py +186 -0
  1530. package/python/lib/python3.14/xml/etree/ElementPath.py +430 -0
  1531. package/python/lib/python3.14/xml/etree/ElementTree.py +2093 -0
  1532. package/python/lib/python3.14/xml/etree/__init__.py +33 -0
  1533. package/python/lib/python3.14/xml/etree/__pycache__/ElementInclude.cpython-314.pyc +0 -0
  1534. package/python/lib/python3.14/xml/etree/__pycache__/ElementPath.cpython-314.pyc +0 -0
  1535. package/python/lib/python3.14/xml/etree/__pycache__/ElementTree.cpython-314.pyc +0 -0
  1536. package/python/lib/python3.14/xml/etree/__pycache__/__init__.cpython-314.pyc +0 -0
  1537. package/python/lib/python3.14/xml/etree/__pycache__/cElementTree.cpython-314.pyc +0 -0
  1538. package/python/lib/python3.14/xml/etree/cElementTree.py +3 -0
  1539. package/python/lib/python3.14/xml/parsers/__init__.py +8 -0
  1540. package/python/lib/python3.14/xml/parsers/__pycache__/__init__.cpython-314.pyc +0 -0
  1541. package/python/lib/python3.14/xml/parsers/__pycache__/expat.cpython-314.pyc +0 -0
  1542. package/python/lib/python3.14/xml/parsers/expat.py +8 -0
  1543. package/python/lib/python3.14/xml/sax/__init__.py +109 -0
  1544. package/python/lib/python3.14/xml/sax/__pycache__/__init__.cpython-314.pyc +0 -0
  1545. package/python/lib/python3.14/xml/sax/__pycache__/_exceptions.cpython-314.pyc +0 -0
  1546. package/python/lib/python3.14/xml/sax/__pycache__/expatreader.cpython-314.pyc +0 -0
  1547. package/python/lib/python3.14/xml/sax/__pycache__/handler.cpython-314.pyc +0 -0
  1548. package/python/lib/python3.14/xml/sax/__pycache__/saxutils.cpython-314.pyc +0 -0
  1549. package/python/lib/python3.14/xml/sax/__pycache__/xmlreader.cpython-314.pyc +0 -0
  1550. package/python/lib/python3.14/xml/sax/_exceptions.py +127 -0
  1551. package/python/lib/python3.14/xml/sax/expatreader.py +454 -0
  1552. package/python/lib/python3.14/xml/sax/handler.py +387 -0
  1553. package/python/lib/python3.14/xml/sax/saxutils.py +370 -0
  1554. package/python/lib/python3.14/xml/sax/xmlreader.py +379 -0
  1555. package/python/lib/python3.14/xmlrpc/__init__.py +1 -0
  1556. package/python/lib/python3.14/xmlrpc/__pycache__/__init__.cpython-314.pyc +0 -0
  1557. package/python/lib/python3.14/xmlrpc/__pycache__/client.cpython-314.pyc +0 -0
  1558. package/python/lib/python3.14/xmlrpc/__pycache__/server.cpython-314.pyc +0 -0
  1559. package/python/lib/python3.14/xmlrpc/client.py +1503 -0
  1560. package/python/lib/python3.14/xmlrpc/server.py +1003 -0
  1561. package/python/lib/python3.14/zipapp.py +231 -0
  1562. package/python/lib/python3.14/zipfile/__init__.py +2488 -0
  1563. package/python/lib/python3.14/zipfile/__main__.py +4 -0
  1564. package/python/lib/python3.14/zipfile/__pycache__/__init__.cpython-314.pyc +0 -0
  1565. package/python/lib/python3.14/zipfile/__pycache__/__main__.cpython-314.pyc +0 -0
  1566. package/python/lib/python3.14/zipfile/_path/__init__.py +455 -0
  1567. package/python/lib/python3.14/zipfile/_path/__pycache__/__init__.cpython-314.pyc +0 -0
  1568. package/python/lib/python3.14/zipfile/_path/__pycache__/glob.cpython-314.pyc +0 -0
  1569. package/python/lib/python3.14/zipfile/_path/glob.py +113 -0
  1570. package/python/lib/python3.14/zipimport.py +827 -0
  1571. package/python/lib/python3.14/zoneinfo/__init__.py +34 -0
  1572. package/python/lib/python3.14/zoneinfo/__pycache__/__init__.cpython-314.pyc +0 -0
  1573. package/python/lib/python3.14/zoneinfo/__pycache__/_common.cpython-314.pyc +0 -0
  1574. package/python/lib/python3.14/zoneinfo/__pycache__/_tzpath.cpython-314.pyc +0 -0
  1575. package/python/lib/python3.14/zoneinfo/__pycache__/_zoneinfo.cpython-314.pyc +0 -0
  1576. package/python/lib/python3.14/zoneinfo/_common.py +172 -0
  1577. package/python/lib/python3.14/zoneinfo/_tzpath.py +189 -0
  1578. package/python/lib/python3.14/zoneinfo/_zoneinfo.py +779 -0
  1579. package/python/licenses/LICENSE.bdb.txt +126 -0
  1580. package/python/licenses/LICENSE.bzip2.txt +37 -0
  1581. package/python/licenses/LICENSE.cpython.txt +771 -0
  1582. package/python/licenses/LICENSE.expat.txt +21 -0
  1583. package/python/licenses/LICENSE.libX11.txt +942 -0
  1584. package/python/licenses/LICENSE.libXau.txt +21 -0
  1585. package/python/licenses/LICENSE.libedit.txt +29 -0
  1586. package/python/licenses/LICENSE.libffi.txt +21 -0
  1587. package/python/licenses/LICENSE.liblzma.txt +13 -0
  1588. package/python/licenses/LICENSE.libuuid.txt +27 -0
  1589. package/python/licenses/LICENSE.libxcb.txt +30 -0
  1590. package/python/licenses/LICENSE.mpdecimal.txt +24 -0
  1591. package/python/licenses/LICENSE.ncurses.txt +29 -0
  1592. package/python/licenses/LICENSE.openssl-3.txt +177 -0
  1593. package/python/licenses/LICENSE.sqlite.txt +23 -0
  1594. package/python/licenses/LICENSE.tcl.txt +40 -0
  1595. package/python/licenses/LICENSE.tix.txt +54 -0
  1596. package/python/licenses/LICENSE.zlib-ng.txt +19 -0
  1597. package/python/licenses/LICENSE.zlib.txt +22 -0
  1598. package/python/licenses/LICENSE.zstd.txt +30 -0
@@ -0,0 +1,3164 @@
1
+ """Header value parser implementing various email-related RFC parsing rules.
2
+
3
+ The parsing methods defined in this module implement various email related
4
+ parsing rules. Principal among them is RFC 5322, which is the followon
5
+ to RFC 2822 and primarily a clarification of the former. It also implements
6
+ RFC 2047 encoded word decoding.
7
+
8
+ RFC 5322 goes to considerable trouble to maintain backward compatibility with
9
+ RFC 822 in the parse phase, while cleaning up the structure on the generation
10
+ phase. This parser supports correct RFC 5322 generation by tagging white space
11
+ as folding white space only when folding is allowed in the non-obsolete rule
12
+ sets. Actually, the parser is even more generous when accepting input than RFC
13
+ 5322 mandates, following the spirit of Postel's Law, which RFC 5322 encourages.
14
+ Where possible deviations from the standard are annotated on the 'defects'
15
+ attribute of tokens that deviate.
16
+
17
+ The general structure of the parser follows RFC 5322, and uses its terminology
18
+ where there is a direct correspondence. Where the implementation requires a
19
+ somewhat different structure than that used by the formal grammar, new terms
20
+ that mimic the closest existing terms are used. Thus, it really helps to have
21
+ a copy of RFC 5322 handy when studying this code.
22
+
23
+ Input to the parser is a string that has already been unfolded according to
24
+ RFC 5322 rules. According to the RFC this unfolding is the very first step, and
25
+ this parser leaves the unfolding step to a higher level message parser, which
26
+ will have already detected the line breaks that need unfolding while
27
+ determining the beginning and end of each header.
28
+
29
+ The output of the parser is a TokenList object, which is a list subclass. A
30
+ TokenList is a recursive data structure. The terminal nodes of the structure
31
+ are Terminal objects, which are subclasses of str. These do not correspond
32
+ directly to terminal objects in the formal grammar, but are instead more
33
+ practical higher level combinations of true terminals.
34
+
35
+ All TokenList and Terminal objects have a 'value' attribute, which produces the
36
+ semantically meaningful value of that part of the parse subtree. The value of
37
+ all whitespace tokens (no matter how many sub-tokens they may contain) is a
38
+ single space, as per the RFC rules. This includes 'CFWS', which is herein
39
+ included in the general class of whitespace tokens. There is one exception to
40
+ the rule that whitespace tokens are collapsed into single spaces in values: in
41
+ the value of a 'bare-quoted-string' (a quoted-string with no leading or
42
+ trailing whitespace), any whitespace that appeared between the quotation marks
43
+ is preserved in the returned value. Note that in all Terminal strings quoted
44
+ pairs are turned into their unquoted values.
45
+
46
+ All TokenList and Terminal objects also have a string value, which attempts to
47
+ be a "canonical" representation of the RFC-compliant form of the substring that
48
+ produced the parsed subtree, including minimal use of quoted pair quoting.
49
+ Whitespace runs are not collapsed.
50
+
51
+ Comment tokens also have a 'content' attribute providing the string found
52
+ between the parens (including any nested comments) with whitespace preserved.
53
+
54
+ All TokenList and Terminal objects have a 'defects' attribute which is a
55
+ possibly empty list all of the defects found while creating the token. Defects
56
+ may appear on any token in the tree, and a composite list of all defects in the
57
+ subtree is available through the 'all_defects' attribute of any node. (For
58
+ Terminal notes x.defects == x.all_defects.)
59
+
60
+ Each object in a parse tree is called a 'token', and each has a 'token_type'
61
+ attribute that gives the name from the RFC 5322 grammar that it represents.
62
+ Not all RFC 5322 nodes are produced, and there is one non-RFC 5322 node that
63
+ may be produced: 'ptext'. A 'ptext' is a string of printable ascii characters.
64
+ It is returned in place of lists of (ctext/quoted-pair) and
65
+ (qtext/quoted-pair).
66
+
67
+ XXX: provide complete list of token types.
68
+ """
69
+
70
+ import re
71
+ import sys
72
+ import urllib # For urllib.parse.unquote
73
+ from string import hexdigits
74
+ from operator import itemgetter
75
+ from email import _encoded_words as _ew
76
+ from email import errors
77
+ from email import utils
78
+
79
+ #
80
+ # Useful constants and functions
81
+ #
82
+
83
+ _WSP = ' \t'
84
+ WSP = set(_WSP)
85
+ CFWS_LEADER = WSP | set('(')
86
+ SPECIALS = set(r'()<>@,:;.\"[]')
87
+ ATOM_ENDS = SPECIALS | WSP
88
+ DOT_ATOM_ENDS = ATOM_ENDS - set('.')
89
+ # '.', '"', and '(' do not end phrases in order to support obs-phrase
90
+ PHRASE_ENDS = SPECIALS - set('."(')
91
+ TSPECIALS = (SPECIALS | set('/?=')) - set('.')
92
+ TOKEN_ENDS = TSPECIALS | WSP
93
+ ASPECIALS = TSPECIALS | set("*'%")
94
+ ATTRIBUTE_ENDS = ASPECIALS | WSP
95
+ EXTENDED_ATTRIBUTE_ENDS = ATTRIBUTE_ENDS - set('%')
96
+ NLSET = {'\n', '\r'}
97
+ SPECIALSNL = SPECIALS | NLSET
98
+
99
+
100
+ def make_quoted_pairs(value):
101
+ """Escape dquote and backslash for use within a quoted-string."""
102
+ return str(value).replace('\\', '\\\\').replace('"', '\\"')
103
+
104
+
105
+ def make_parenthesis_pairs(value):
106
+ """Escape parenthesis and backslash for use within a comment."""
107
+ return str(value).replace('\\', '\\\\') \
108
+ .replace('(', '\\(').replace(')', '\\)')
109
+
110
+
111
+ def quote_string(value):
112
+ escaped = make_quoted_pairs(value)
113
+ return f'"{escaped}"'
114
+
115
+
116
+ # Match a RFC 2047 word, looks like =?utf-8?q?someword?=
117
+ rfc2047_matcher = re.compile(r'''
118
+ =\? # literal =?
119
+ [^?]* # charset
120
+ \? # literal ?
121
+ [qQbB] # literal 'q' or 'b', case insensitive
122
+ \? # literal ?
123
+ .*? # encoded word
124
+ \?= # literal ?=
125
+ ''', re.VERBOSE | re.MULTILINE)
126
+
127
+
128
+ #
129
+ # TokenList and its subclasses
130
+ #
131
+
132
+ class TokenList(list):
133
+
134
+ token_type = None
135
+ syntactic_break = True
136
+ ew_combine_allowed = True
137
+
138
+ def __init__(self, *args, **kw):
139
+ super().__init__(*args, **kw)
140
+ self.defects = []
141
+
142
+ def __str__(self):
143
+ return ''.join(str(x) for x in self)
144
+
145
+ def __repr__(self):
146
+ return '{}({})'.format(self.__class__.__name__,
147
+ super().__repr__())
148
+
149
+ @property
150
+ def value(self):
151
+ return ''.join(x.value for x in self if x.value)
152
+
153
+ @property
154
+ def all_defects(self):
155
+ return sum((x.all_defects for x in self), self.defects)
156
+
157
+ def startswith_fws(self):
158
+ return self[0].startswith_fws()
159
+
160
+ @property
161
+ def as_ew_allowed(self):
162
+ """True if all top level tokens of this part may be RFC2047 encoded."""
163
+ return all(part.as_ew_allowed for part in self)
164
+
165
+ @property
166
+ def comments(self):
167
+ comments = []
168
+ for token in self:
169
+ comments.extend(token.comments)
170
+ return comments
171
+
172
+ def contains_token_type(self, *token_types):
173
+ if self.token_type in token_types:
174
+ return True
175
+ for t in self:
176
+ if t.contains_token_type(*token_types):
177
+ return True
178
+ return False
179
+
180
+ def fold(self, *, policy):
181
+ return _refold_parse_tree(self, policy=policy)
182
+
183
+ def pprint(self, indent=''):
184
+ print(self.ppstr(indent=indent))
185
+
186
+ def ppstr(self, indent=''):
187
+ return '\n'.join(self._pp(indent=indent))
188
+
189
+ def _pp(self, indent=''):
190
+ yield '{}{}/{}('.format(
191
+ indent,
192
+ self.__class__.__name__,
193
+ self.token_type)
194
+ for token in self:
195
+ if not hasattr(token, '_pp'):
196
+ yield (indent + ' !! invalid element in token '
197
+ 'list: {!r}'.format(token))
198
+ else:
199
+ yield from token._pp(indent+' ')
200
+ if self.defects:
201
+ extra = ' Defects: {}'.format(self.defects)
202
+ else:
203
+ extra = ''
204
+ yield '{}){}'.format(indent, extra)
205
+
206
+
207
+ class WhiteSpaceTokenList(TokenList):
208
+
209
+ @property
210
+ def value(self):
211
+ return ' '
212
+
213
+ @property
214
+ def comments(self):
215
+ return [x.content for x in self if x.token_type=='comment']
216
+
217
+
218
+ class UnstructuredTokenList(TokenList):
219
+ token_type = 'unstructured'
220
+
221
+
222
+ class Phrase(TokenList):
223
+ token_type = 'phrase'
224
+
225
+ class Word(TokenList):
226
+ token_type = 'word'
227
+
228
+
229
+ class CFWSList(WhiteSpaceTokenList):
230
+ token_type = 'cfws'
231
+
232
+
233
+ class Atom(TokenList):
234
+ token_type = 'atom'
235
+
236
+
237
+ class Token(TokenList):
238
+ token_type = 'token'
239
+ encode_as_ew = False
240
+
241
+
242
+ class EncodedWord(TokenList):
243
+ token_type = 'encoded-word'
244
+ cte = None
245
+ charset = None
246
+ lang = None
247
+
248
+
249
+ class QuotedString(TokenList):
250
+
251
+ token_type = 'quoted-string'
252
+
253
+ @property
254
+ def content(self):
255
+ for x in self:
256
+ if x.token_type == 'bare-quoted-string':
257
+ return x.value
258
+
259
+ @property
260
+ def quoted_value(self):
261
+ res = []
262
+ for x in self:
263
+ if x.token_type == 'bare-quoted-string':
264
+ res.append(str(x))
265
+ else:
266
+ res.append(x.value)
267
+ return ''.join(res)
268
+
269
+ @property
270
+ def stripped_value(self):
271
+ for token in self:
272
+ if token.token_type == 'bare-quoted-string':
273
+ return token.value
274
+
275
+
276
+ class BareQuotedString(QuotedString):
277
+
278
+ token_type = 'bare-quoted-string'
279
+
280
+ def __str__(self):
281
+ return quote_string(''.join(str(x) for x in self))
282
+
283
+ @property
284
+ def value(self):
285
+ return ''.join(str(x) for x in self)
286
+
287
+
288
+ class Comment(WhiteSpaceTokenList):
289
+
290
+ token_type = 'comment'
291
+
292
+ def __str__(self):
293
+ return ''.join(sum([
294
+ ["("],
295
+ [self.quote(x) for x in self],
296
+ [")"],
297
+ ], []))
298
+
299
+ def quote(self, value):
300
+ if value.token_type == 'comment':
301
+ return str(value)
302
+ return str(value).replace('\\', '\\\\').replace(
303
+ '(', r'\(').replace(
304
+ ')', r'\)')
305
+
306
+ @property
307
+ def content(self):
308
+ return ''.join(str(x) for x in self)
309
+
310
+ @property
311
+ def comments(self):
312
+ return [self.content]
313
+
314
+ class AddressList(TokenList):
315
+
316
+ token_type = 'address-list'
317
+
318
+ @property
319
+ def addresses(self):
320
+ return [x for x in self if x.token_type=='address']
321
+
322
+ @property
323
+ def mailboxes(self):
324
+ return sum((x.mailboxes
325
+ for x in self if x.token_type=='address'), [])
326
+
327
+ @property
328
+ def all_mailboxes(self):
329
+ return sum((x.all_mailboxes
330
+ for x in self if x.token_type=='address'), [])
331
+
332
+
333
+ class Address(TokenList):
334
+
335
+ token_type = 'address'
336
+
337
+ @property
338
+ def display_name(self):
339
+ if self[0].token_type == 'group':
340
+ return self[0].display_name
341
+
342
+ @property
343
+ def mailboxes(self):
344
+ if self[0].token_type == 'mailbox':
345
+ return [self[0]]
346
+ elif self[0].token_type == 'invalid-mailbox':
347
+ return []
348
+ return self[0].mailboxes
349
+
350
+ @property
351
+ def all_mailboxes(self):
352
+ if self[0].token_type == 'mailbox':
353
+ return [self[0]]
354
+ elif self[0].token_type == 'invalid-mailbox':
355
+ return [self[0]]
356
+ return self[0].all_mailboxes
357
+
358
+ class MailboxList(TokenList):
359
+
360
+ token_type = 'mailbox-list'
361
+
362
+ @property
363
+ def mailboxes(self):
364
+ return [x for x in self if x.token_type=='mailbox']
365
+
366
+ @property
367
+ def all_mailboxes(self):
368
+ return [x for x in self
369
+ if x.token_type in ('mailbox', 'invalid-mailbox')]
370
+
371
+
372
+ class GroupList(TokenList):
373
+
374
+ token_type = 'group-list'
375
+
376
+ @property
377
+ def mailboxes(self):
378
+ if not self or self[0].token_type != 'mailbox-list':
379
+ return []
380
+ return self[0].mailboxes
381
+
382
+ @property
383
+ def all_mailboxes(self):
384
+ if not self or self[0].token_type != 'mailbox-list':
385
+ return []
386
+ return self[0].all_mailboxes
387
+
388
+
389
+ class Group(TokenList):
390
+
391
+ token_type = "group"
392
+
393
+ @property
394
+ def mailboxes(self):
395
+ if self[2].token_type != 'group-list':
396
+ return []
397
+ return self[2].mailboxes
398
+
399
+ @property
400
+ def all_mailboxes(self):
401
+ if self[2].token_type != 'group-list':
402
+ return []
403
+ return self[2].all_mailboxes
404
+
405
+ @property
406
+ def display_name(self):
407
+ return self[0].display_name
408
+
409
+
410
+ class NameAddr(TokenList):
411
+
412
+ token_type = 'name-addr'
413
+
414
+ @property
415
+ def display_name(self):
416
+ if len(self) == 1:
417
+ return None
418
+ return self[0].display_name
419
+
420
+ @property
421
+ def local_part(self):
422
+ return self[-1].local_part
423
+
424
+ @property
425
+ def domain(self):
426
+ return self[-1].domain
427
+
428
+ @property
429
+ def route(self):
430
+ return self[-1].route
431
+
432
+ @property
433
+ def addr_spec(self):
434
+ return self[-1].addr_spec
435
+
436
+
437
+ class AngleAddr(TokenList):
438
+
439
+ token_type = 'angle-addr'
440
+
441
+ @property
442
+ def local_part(self):
443
+ for x in self:
444
+ if x.token_type == 'addr-spec':
445
+ return x.local_part
446
+
447
+ @property
448
+ def domain(self):
449
+ for x in self:
450
+ if x.token_type == 'addr-spec':
451
+ return x.domain
452
+
453
+ @property
454
+ def route(self):
455
+ for x in self:
456
+ if x.token_type == 'obs-route':
457
+ return x.domains
458
+
459
+ @property
460
+ def addr_spec(self):
461
+ for x in self:
462
+ if x.token_type == 'addr-spec':
463
+ if x.local_part:
464
+ return x.addr_spec
465
+ else:
466
+ return quote_string(x.local_part) + x.addr_spec
467
+ else:
468
+ return '<>'
469
+
470
+
471
+ class ObsRoute(TokenList):
472
+
473
+ token_type = 'obs-route'
474
+
475
+ @property
476
+ def domains(self):
477
+ return [x.domain for x in self if x.token_type == 'domain']
478
+
479
+
480
+ class Mailbox(TokenList):
481
+
482
+ token_type = 'mailbox'
483
+
484
+ @property
485
+ def display_name(self):
486
+ if self[0].token_type == 'name-addr':
487
+ return self[0].display_name
488
+
489
+ @property
490
+ def local_part(self):
491
+ return self[0].local_part
492
+
493
+ @property
494
+ def domain(self):
495
+ return self[0].domain
496
+
497
+ @property
498
+ def route(self):
499
+ if self[0].token_type == 'name-addr':
500
+ return self[0].route
501
+
502
+ @property
503
+ def addr_spec(self):
504
+ return self[0].addr_spec
505
+
506
+
507
+ class InvalidMailbox(TokenList):
508
+
509
+ token_type = 'invalid-mailbox'
510
+
511
+ @property
512
+ def display_name(self):
513
+ return None
514
+
515
+ local_part = domain = route = addr_spec = display_name
516
+
517
+
518
+ class Domain(TokenList):
519
+
520
+ token_type = 'domain'
521
+ as_ew_allowed = False
522
+
523
+ @property
524
+ def domain(self):
525
+ return ''.join(super().value.split())
526
+
527
+
528
+ class DotAtom(TokenList):
529
+ token_type = 'dot-atom'
530
+
531
+
532
+ class DotAtomText(TokenList):
533
+ token_type = 'dot-atom-text'
534
+ as_ew_allowed = True
535
+
536
+
537
+ class NoFoldLiteral(TokenList):
538
+ token_type = 'no-fold-literal'
539
+ as_ew_allowed = False
540
+
541
+
542
+ class AddrSpec(TokenList):
543
+
544
+ token_type = 'addr-spec'
545
+ as_ew_allowed = False
546
+
547
+ @property
548
+ def local_part(self):
549
+ return self[0].local_part
550
+
551
+ @property
552
+ def domain(self):
553
+ if len(self) < 3:
554
+ return None
555
+ return self[-1].domain
556
+
557
+ @property
558
+ def value(self):
559
+ if len(self) < 3:
560
+ return self[0].value
561
+ return self[0].value.rstrip()+self[1].value+self[2].value.lstrip()
562
+
563
+ @property
564
+ def addr_spec(self):
565
+ nameset = set(self.local_part)
566
+ if len(nameset) > len(nameset-DOT_ATOM_ENDS):
567
+ lp = quote_string(self.local_part)
568
+ else:
569
+ lp = self.local_part
570
+ if self.domain is not None:
571
+ return lp + '@' + self.domain
572
+ return lp
573
+
574
+
575
+ class ObsLocalPart(TokenList):
576
+
577
+ token_type = 'obs-local-part'
578
+ as_ew_allowed = False
579
+
580
+
581
+ class DisplayName(Phrase):
582
+
583
+ token_type = 'display-name'
584
+ ew_combine_allowed = False
585
+
586
+ @property
587
+ def display_name(self):
588
+ res = TokenList(self)
589
+ if len(res) == 0:
590
+ return res.value
591
+ if res[0].token_type == 'cfws':
592
+ res.pop(0)
593
+ else:
594
+ if (isinstance(res[0], TokenList) and
595
+ res[0][0].token_type == 'cfws'):
596
+ res[0] = TokenList(res[0][1:])
597
+ if res[-1].token_type == 'cfws':
598
+ res.pop()
599
+ else:
600
+ if (isinstance(res[-1], TokenList) and
601
+ res[-1][-1].token_type == 'cfws'):
602
+ res[-1] = TokenList(res[-1][:-1])
603
+ return res.value
604
+
605
+ @property
606
+ def value(self):
607
+ quote = False
608
+ if self.defects:
609
+ quote = True
610
+ else:
611
+ for x in self:
612
+ if x.token_type == 'quoted-string':
613
+ quote = True
614
+ if len(self) != 0 and quote:
615
+ pre = post = ''
616
+ if (self[0].token_type == 'cfws' or
617
+ isinstance(self[0], TokenList) and
618
+ self[0][0].token_type == 'cfws'):
619
+ pre = ' '
620
+ if (self[-1].token_type == 'cfws' or
621
+ isinstance(self[-1], TokenList) and
622
+ self[-1][-1].token_type == 'cfws'):
623
+ post = ' '
624
+ return pre+quote_string(self.display_name)+post
625
+ else:
626
+ return super().value
627
+
628
+
629
+ class LocalPart(TokenList):
630
+
631
+ token_type = 'local-part'
632
+ as_ew_allowed = False
633
+
634
+ @property
635
+ def value(self):
636
+ if self[0].token_type == "quoted-string":
637
+ return self[0].quoted_value
638
+ else:
639
+ return self[0].value
640
+
641
+ @property
642
+ def local_part(self):
643
+ # Strip whitespace from front, back, and around dots.
644
+ res = [DOT]
645
+ last = DOT
646
+ last_is_tl = False
647
+ for tok in self[0] + [DOT]:
648
+ if tok.token_type == 'cfws':
649
+ continue
650
+ if (last_is_tl and tok.token_type == 'dot' and last and
651
+ last[-1].token_type == 'cfws'):
652
+ res[-1] = TokenList(last[:-1])
653
+ is_tl = isinstance(tok, TokenList)
654
+ if (is_tl and last.token_type == 'dot' and tok and
655
+ tok[0].token_type == 'cfws'):
656
+ res.append(TokenList(tok[1:]))
657
+ else:
658
+ res.append(tok)
659
+ last = res[-1]
660
+ last_is_tl = is_tl
661
+ res = TokenList(res[1:-1])
662
+ return res.value
663
+
664
+
665
+ class DomainLiteral(TokenList):
666
+
667
+ token_type = 'domain-literal'
668
+ as_ew_allowed = False
669
+
670
+ @property
671
+ def domain(self):
672
+ return ''.join(super().value.split())
673
+
674
+ @property
675
+ def ip(self):
676
+ for x in self:
677
+ if x.token_type == 'ptext':
678
+ return x.value
679
+
680
+
681
+ class MIMEVersion(TokenList):
682
+
683
+ token_type = 'mime-version'
684
+ major = None
685
+ minor = None
686
+
687
+
688
+ class Parameter(TokenList):
689
+
690
+ token_type = 'parameter'
691
+ sectioned = False
692
+ extended = False
693
+ charset = 'us-ascii'
694
+
695
+ @property
696
+ def section_number(self):
697
+ # Because the first token, the attribute (name) eats CFWS, the second
698
+ # token is always the section if there is one.
699
+ return self[1].number if self.sectioned else 0
700
+
701
+ @property
702
+ def param_value(self):
703
+ # This is part of the "handle quoted extended parameters" hack.
704
+ for token in self:
705
+ if token.token_type == 'value':
706
+ return token.stripped_value
707
+ if token.token_type == 'quoted-string':
708
+ for token in token:
709
+ if token.token_type == 'bare-quoted-string':
710
+ for token in token:
711
+ if token.token_type == 'value':
712
+ return token.stripped_value
713
+ return ''
714
+
715
+
716
+ class InvalidParameter(Parameter):
717
+
718
+ token_type = 'invalid-parameter'
719
+
720
+
721
+ class Attribute(TokenList):
722
+
723
+ token_type = 'attribute'
724
+
725
+ @property
726
+ def stripped_value(self):
727
+ for token in self:
728
+ if token.token_type.endswith('attrtext'):
729
+ return token.value
730
+
731
+ class Section(TokenList):
732
+
733
+ token_type = 'section'
734
+ number = None
735
+
736
+
737
+ class Value(TokenList):
738
+
739
+ token_type = 'value'
740
+
741
+ @property
742
+ def stripped_value(self):
743
+ token = self[0]
744
+ if token.token_type == 'cfws':
745
+ token = self[1]
746
+ if token.token_type.endswith(
747
+ ('quoted-string', 'attribute', 'extended-attribute')):
748
+ return token.stripped_value
749
+ return self.value
750
+
751
+
752
+ class MimeParameters(TokenList):
753
+
754
+ token_type = 'mime-parameters'
755
+ syntactic_break = False
756
+
757
+ @property
758
+ def params(self):
759
+ # The RFC specifically states that the ordering of parameters is not
760
+ # guaranteed and may be reordered by the transport layer. So we have
761
+ # to assume the RFC 2231 pieces can come in any order. However, we
762
+ # output them in the order that we first see a given name, which gives
763
+ # us a stable __str__.
764
+ params = {} # Using order preserving dict from Python 3.7+
765
+ for token in self:
766
+ if not token.token_type.endswith('parameter'):
767
+ continue
768
+ if token[0].token_type != 'attribute':
769
+ continue
770
+ name = token[0].value.strip()
771
+ if name not in params:
772
+ params[name] = []
773
+ params[name].append((token.section_number, token))
774
+ for name, parts in params.items():
775
+ parts = sorted(parts, key=itemgetter(0))
776
+ first_param = parts[0][1]
777
+ charset = first_param.charset
778
+ # Our arbitrary error recovery is to ignore duplicate parameters,
779
+ # to use appearance order if there are duplicate rfc 2231 parts,
780
+ # and to ignore gaps. This mimics the error recovery of get_param.
781
+ if not first_param.extended and len(parts) > 1:
782
+ if parts[1][0] == 0:
783
+ parts[1][1].defects.append(errors.InvalidHeaderDefect(
784
+ 'duplicate parameter name; duplicate(s) ignored'))
785
+ parts = parts[:1]
786
+ # Else assume the *0* was missing...note that this is different
787
+ # from get_param, but we registered a defect for this earlier.
788
+ value_parts = []
789
+ i = 0
790
+ for section_number, param in parts:
791
+ if section_number != i:
792
+ # We could get fancier here and look for a complete
793
+ # duplicate extended parameter and ignore the second one
794
+ # seen. But we're not doing that. The old code didn't.
795
+ if not param.extended:
796
+ param.defects.append(errors.InvalidHeaderDefect(
797
+ 'duplicate parameter name; duplicate ignored'))
798
+ continue
799
+ else:
800
+ param.defects.append(errors.InvalidHeaderDefect(
801
+ "inconsistent RFC2231 parameter numbering"))
802
+ i += 1
803
+ value = param.param_value
804
+ if param.extended:
805
+ try:
806
+ value = urllib.parse.unquote_to_bytes(value)
807
+ except UnicodeEncodeError:
808
+ # source had surrogate escaped bytes. What we do now
809
+ # is a bit of an open question. I'm not sure this is
810
+ # the best choice, but it is what the old algorithm did
811
+ value = urllib.parse.unquote(value, encoding='latin-1')
812
+ else:
813
+ try:
814
+ value = value.decode(charset, 'surrogateescape')
815
+ except (LookupError, UnicodeEncodeError):
816
+ # XXX: there should really be a custom defect for
817
+ # unknown character set to make it easy to find,
818
+ # because otherwise unknown charset is a silent
819
+ # failure.
820
+ value = value.decode('us-ascii', 'surrogateescape')
821
+ if utils._has_surrogates(value):
822
+ param.defects.append(errors.UndecodableBytesDefect())
823
+ value_parts.append(value)
824
+ value = ''.join(value_parts)
825
+ yield name, value
826
+
827
+ def __str__(self):
828
+ params = []
829
+ for name, value in self.params:
830
+ if value:
831
+ params.append('{}={}'.format(name, quote_string(value)))
832
+ else:
833
+ params.append(name)
834
+ params = '; '.join(params)
835
+ return ' ' + params if params else ''
836
+
837
+
838
+ class ParameterizedHeaderValue(TokenList):
839
+
840
+ # Set this false so that the value doesn't wind up on a new line even
841
+ # if it and the parameters would fit there but not on the first line.
842
+ syntactic_break = False
843
+
844
+ @property
845
+ def params(self):
846
+ for token in reversed(self):
847
+ if token.token_type == 'mime-parameters':
848
+ return token.params
849
+ return {}
850
+
851
+
852
+ class ContentType(ParameterizedHeaderValue):
853
+ token_type = 'content-type'
854
+ as_ew_allowed = False
855
+ maintype = 'text'
856
+ subtype = 'plain'
857
+
858
+
859
+ class ContentDisposition(ParameterizedHeaderValue):
860
+ token_type = 'content-disposition'
861
+ as_ew_allowed = False
862
+ content_disposition = None
863
+
864
+
865
+ class ContentTransferEncoding(TokenList):
866
+ token_type = 'content-transfer-encoding'
867
+ as_ew_allowed = False
868
+ cte = '7bit'
869
+
870
+
871
+ class HeaderLabel(TokenList):
872
+ token_type = 'header-label'
873
+ as_ew_allowed = False
874
+
875
+
876
+ class MsgID(TokenList):
877
+ token_type = 'msg-id'
878
+ as_ew_allowed = False
879
+
880
+ def fold(self, policy):
881
+ # message-id tokens may not be folded.
882
+ return str(self) + policy.linesep
883
+
884
+
885
+ class MessageID(MsgID):
886
+ token_type = 'message-id'
887
+
888
+
889
+ class InvalidMessageID(MessageID):
890
+ token_type = 'invalid-message-id'
891
+
892
+ class MessageIDList(TokenList):
893
+ token_type = 'message-id-list'
894
+
895
+ @property
896
+ def message_ids(self):
897
+ return [x for x in self if x.token_type=='msg-id']
898
+
899
+ class Header(TokenList):
900
+ token_type = 'header'
901
+
902
+
903
+ #
904
+ # Terminal classes and instances
905
+ #
906
+
907
+ class Terminal(str):
908
+
909
+ as_ew_allowed = True
910
+ ew_combine_allowed = True
911
+ syntactic_break = True
912
+
913
+ def __new__(cls, value, token_type):
914
+ self = super().__new__(cls, value)
915
+ self.token_type = token_type
916
+ self.defects = []
917
+ return self
918
+
919
+ def __repr__(self):
920
+ return "{}({})".format(self.__class__.__name__, super().__repr__())
921
+
922
+ def pprint(self):
923
+ print(self.__class__.__name__ + '/' + self.token_type)
924
+
925
+ @property
926
+ def all_defects(self):
927
+ return list(self.defects)
928
+
929
+ def _pp(self, indent=''):
930
+ return ["{}{}/{}({}){}".format(
931
+ indent,
932
+ self.__class__.__name__,
933
+ self.token_type,
934
+ super().__repr__(),
935
+ '' if not self.defects else ' {}'.format(self.defects),
936
+ )]
937
+
938
+ def pop_trailing_ws(self):
939
+ # This terminates the recursion.
940
+ return None
941
+
942
+ @property
943
+ def comments(self):
944
+ return []
945
+
946
+ def contains_token_type(self, *token_types):
947
+ return self.token_type in token_types
948
+
949
+ def __getnewargs__(self):
950
+ return(str(self), self.token_type)
951
+
952
+
953
+ class WhiteSpaceTerminal(Terminal):
954
+
955
+ @property
956
+ def value(self):
957
+ return ' '
958
+
959
+ def startswith_fws(self):
960
+ return self and self[0] in WSP
961
+
962
+
963
+ class ValueTerminal(Terminal):
964
+
965
+ @property
966
+ def value(self):
967
+ return self
968
+
969
+ def startswith_fws(self):
970
+ return False
971
+
972
+
973
+ class EWWhiteSpaceTerminal(WhiteSpaceTerminal):
974
+
975
+ @property
976
+ def value(self):
977
+ return ''
978
+
979
+ def __str__(self):
980
+ return ''
981
+
982
+
983
+ class _InvalidEwError(errors.HeaderParseError):
984
+ """Invalid encoded word found while parsing headers."""
985
+
986
+
987
+ # XXX these need to become classes and used as instances so
988
+ # that a program can't change them in a parse tree and screw
989
+ # up other parse trees. Maybe should have tests for that, too.
990
+ DOT = ValueTerminal('.', 'dot')
991
+ ListSeparator = ValueTerminal(',', 'list-separator')
992
+ ListSeparator.as_ew_allowed = False
993
+ ListSeparator.syntactic_break = False
994
+ RouteComponentMarker = ValueTerminal('@', 'route-component-marker')
995
+
996
+ #
997
+ # Parser
998
+ #
999
+
1000
+ # Parse strings according to RFC822/2047/2822/5322 rules.
1001
+ #
1002
+ # This is a stateless parser. Each get_XXX function accepts a string and
1003
+ # returns either a Terminal or a TokenList representing the RFC object named
1004
+ # by the method and a string containing the remaining unparsed characters
1005
+ # from the input. Thus a parser method consumes the next syntactic construct
1006
+ # of a given type and returns a token representing the construct plus the
1007
+ # unparsed remainder of the input string.
1008
+ #
1009
+ # For example, if the first element of a structured header is a 'phrase',
1010
+ # then:
1011
+ #
1012
+ # phrase, value = get_phrase(value)
1013
+ #
1014
+ # returns the complete phrase from the start of the string value, plus any
1015
+ # characters left in the string after the phrase is removed.
1016
+
1017
+ _wsp_splitter = re.compile(r'([{}]+)'.format(''.join(WSP))).split
1018
+ _non_atom_end_matcher = re.compile(r"[^{}]+".format(
1019
+ re.escape(''.join(ATOM_ENDS)))).match
1020
+ _non_printable_finder = re.compile(r"[\x00-\x20\x7F]").findall
1021
+ _non_token_end_matcher = re.compile(r"[^{}]+".format(
1022
+ re.escape(''.join(TOKEN_ENDS)))).match
1023
+ _non_attribute_end_matcher = re.compile(r"[^{}]+".format(
1024
+ re.escape(''.join(ATTRIBUTE_ENDS)))).match
1025
+ _non_extended_attribute_end_matcher = re.compile(r"[^{}]+".format(
1026
+ re.escape(''.join(EXTENDED_ATTRIBUTE_ENDS)))).match
1027
+
1028
+ def _validate_xtext(xtext):
1029
+ """If input token contains ASCII non-printables, register a defect."""
1030
+
1031
+ non_printables = _non_printable_finder(xtext)
1032
+ if non_printables:
1033
+ xtext.defects.append(errors.NonPrintableDefect(non_printables))
1034
+ if utils._has_surrogates(xtext):
1035
+ xtext.defects.append(errors.UndecodableBytesDefect(
1036
+ "Non-ASCII characters found in header token"))
1037
+
1038
+ def _get_ptext_to_endchars(value, endchars):
1039
+ """Scan printables/quoted-pairs until endchars and return unquoted ptext.
1040
+
1041
+ This function turns a run of qcontent, ccontent-without-comments, or
1042
+ dtext-with-quoted-printables into a single string by unquoting any
1043
+ quoted printables. It returns the string, the remaining value, and
1044
+ a flag that is True iff there were any quoted printables decoded.
1045
+
1046
+ """
1047
+ if not value:
1048
+ return '', '', False
1049
+ fragment, *remainder = _wsp_splitter(value, 1)
1050
+ vchars = []
1051
+ escape = False
1052
+ had_qp = False
1053
+ for pos in range(len(fragment)):
1054
+ if fragment[pos] == '\\':
1055
+ if escape:
1056
+ escape = False
1057
+ had_qp = True
1058
+ else:
1059
+ escape = True
1060
+ continue
1061
+ if escape:
1062
+ escape = False
1063
+ elif fragment[pos] in endchars:
1064
+ break
1065
+ vchars.append(fragment[pos])
1066
+ else:
1067
+ pos = pos + 1
1068
+ return ''.join(vchars), ''.join([fragment[pos:]] + remainder), had_qp
1069
+
1070
+ def get_fws(value):
1071
+ """FWS = 1*WSP
1072
+
1073
+ This isn't the RFC definition. We're using fws to represent tokens where
1074
+ folding can be done, but when we are parsing the *un*folding has already
1075
+ been done so we don't need to watch out for CRLF.
1076
+
1077
+ """
1078
+ newvalue = value.lstrip()
1079
+ fws = WhiteSpaceTerminal(value[:len(value)-len(newvalue)], 'fws')
1080
+ return fws, newvalue
1081
+
1082
+ def get_encoded_word(value, terminal_type='vtext'):
1083
+ """ encoded-word = "=?" charset "?" encoding "?" encoded-text "?="
1084
+
1085
+ """
1086
+ ew = EncodedWord()
1087
+ if not value.startswith('=?'):
1088
+ raise errors.HeaderParseError(
1089
+ "expected encoded word but found {}".format(value))
1090
+ tok, *remainder = value[2:].split('?=', 1)
1091
+ if tok == value[2:]:
1092
+ raise errors.HeaderParseError(
1093
+ "expected encoded word but found {}".format(value))
1094
+ remstr = ''.join(remainder)
1095
+ if (len(remstr) > 1 and
1096
+ remstr[0] in hexdigits and
1097
+ remstr[1] in hexdigits and
1098
+ tok.count('?') < 2):
1099
+ # The ? after the CTE was followed by an encoded word escape (=XX).
1100
+ rest, *remainder = remstr.split('?=', 1)
1101
+ tok = tok + '?=' + rest
1102
+ if len(tok.split()) > 1:
1103
+ ew.defects.append(errors.InvalidHeaderDefect(
1104
+ "whitespace inside encoded word"))
1105
+ ew.cte = value
1106
+ value = ''.join(remainder)
1107
+ try:
1108
+ text, charset, lang, defects = _ew.decode('=?' + tok + '?=')
1109
+ except (ValueError, KeyError):
1110
+ raise _InvalidEwError(
1111
+ "encoded word format invalid: '{}'".format(ew.cte))
1112
+ ew.charset = charset
1113
+ ew.lang = lang
1114
+ ew.defects.extend(defects)
1115
+ while text:
1116
+ if text[0] in WSP:
1117
+ token, text = get_fws(text)
1118
+ ew.append(token)
1119
+ continue
1120
+ chars, *remainder = _wsp_splitter(text, 1)
1121
+ vtext = ValueTerminal(chars, terminal_type)
1122
+ _validate_xtext(vtext)
1123
+ ew.append(vtext)
1124
+ text = ''.join(remainder)
1125
+ # Encoded words should be followed by a WS
1126
+ if value and value[0] not in WSP:
1127
+ ew.defects.append(errors.InvalidHeaderDefect(
1128
+ "missing trailing whitespace after encoded-word"))
1129
+ return ew, value
1130
+
1131
+ def get_unstructured(value):
1132
+ """unstructured = (*([FWS] vchar) *WSP) / obs-unstruct
1133
+ obs-unstruct = *((*LF *CR *(obs-utext) *LF *CR)) / FWS)
1134
+ obs-utext = %d0 / obs-NO-WS-CTL / LF / CR
1135
+
1136
+ obs-NO-WS-CTL is control characters except WSP/CR/LF.
1137
+
1138
+ So, basically, we have printable runs, plus control characters or nulls in
1139
+ the obsolete syntax, separated by whitespace. Since RFC 2047 uses the
1140
+ obsolete syntax in its specification, but requires whitespace on either
1141
+ side of the encoded words, I can see no reason to need to separate the
1142
+ non-printable-non-whitespace from the printable runs if they occur, so we
1143
+ parse this into xtext tokens separated by WSP tokens.
1144
+
1145
+ Because an 'unstructured' value must by definition constitute the entire
1146
+ value, this 'get' routine does not return a remaining value, only the
1147
+ parsed TokenList.
1148
+
1149
+ """
1150
+ # XXX: but what about bare CR and LF? They might signal the start or
1151
+ # end of an encoded word. YAGNI for now, since our current parsers
1152
+ # will never send us strings with bare CR or LF.
1153
+
1154
+ unstructured = UnstructuredTokenList()
1155
+ while value:
1156
+ if value[0] in WSP:
1157
+ token, value = get_fws(value)
1158
+ unstructured.append(token)
1159
+ continue
1160
+ valid_ew = True
1161
+ if value.startswith('=?'):
1162
+ try:
1163
+ token, value = get_encoded_word(value, 'utext')
1164
+ except _InvalidEwError:
1165
+ valid_ew = False
1166
+ except errors.HeaderParseError:
1167
+ # XXX: Need to figure out how to register defects when
1168
+ # appropriate here.
1169
+ pass
1170
+ else:
1171
+ have_ws = True
1172
+ if len(unstructured) > 0:
1173
+ if unstructured[-1].token_type != 'fws':
1174
+ unstructured.defects.append(errors.InvalidHeaderDefect(
1175
+ "missing whitespace before encoded word"))
1176
+ have_ws = False
1177
+ if have_ws and len(unstructured) > 1:
1178
+ if unstructured[-2].token_type == 'encoded-word':
1179
+ unstructured[-1] = EWWhiteSpaceTerminal(
1180
+ unstructured[-1], 'fws')
1181
+ unstructured.append(token)
1182
+ continue
1183
+ tok, *remainder = _wsp_splitter(value, 1)
1184
+ # Split in the middle of an atom if there is a rfc2047 encoded word
1185
+ # which does not have WSP on both sides. The defect will be registered
1186
+ # the next time through the loop.
1187
+ # This needs to only be performed when the encoded word is valid;
1188
+ # otherwise, performing it on an invalid encoded word can cause
1189
+ # the parser to go in an infinite loop.
1190
+ if valid_ew and rfc2047_matcher.search(tok):
1191
+ tok, *remainder = value.partition('=?')
1192
+ vtext = ValueTerminal(tok, 'utext')
1193
+ _validate_xtext(vtext)
1194
+ unstructured.append(vtext)
1195
+ value = ''.join(remainder)
1196
+ return unstructured
1197
+
1198
+ def get_qp_ctext(value):
1199
+ r"""ctext = <printable ascii except \ ( )>
1200
+
1201
+ This is not the RFC ctext, since we are handling nested comments in comment
1202
+ and unquoting quoted-pairs here. We allow anything except the '()'
1203
+ characters, but if we find any ASCII other than the RFC defined printable
1204
+ ASCII, a NonPrintableDefect is added to the token's defects list. Since
1205
+ quoted pairs are converted to their unquoted values, what is returned is
1206
+ a 'ptext' token. In this case it is a WhiteSpaceTerminal, so it's value
1207
+ is ' '.
1208
+
1209
+ """
1210
+ ptext, value, _ = _get_ptext_to_endchars(value, '()')
1211
+ ptext = WhiteSpaceTerminal(ptext, 'ptext')
1212
+ _validate_xtext(ptext)
1213
+ return ptext, value
1214
+
1215
+ def get_qcontent(value):
1216
+ """qcontent = qtext / quoted-pair
1217
+
1218
+ We allow anything except the DQUOTE character, but if we find any ASCII
1219
+ other than the RFC defined printable ASCII, a NonPrintableDefect is
1220
+ added to the token's defects list. Any quoted pairs are converted to their
1221
+ unquoted values, so what is returned is a 'ptext' token. In this case it
1222
+ is a ValueTerminal.
1223
+
1224
+ """
1225
+ ptext, value, _ = _get_ptext_to_endchars(value, '"')
1226
+ ptext = ValueTerminal(ptext, 'ptext')
1227
+ _validate_xtext(ptext)
1228
+ return ptext, value
1229
+
1230
+ def get_atext(value):
1231
+ """atext = <matches _atext_matcher>
1232
+
1233
+ We allow any non-ATOM_ENDS in atext, but add an InvalidATextDefect to
1234
+ the token's defects list if we find non-atext characters.
1235
+ """
1236
+ m = _non_atom_end_matcher(value)
1237
+ if not m:
1238
+ raise errors.HeaderParseError(
1239
+ "expected atext but found '{}'".format(value))
1240
+ atext = m.group()
1241
+ value = value[len(atext):]
1242
+ atext = ValueTerminal(atext, 'atext')
1243
+ _validate_xtext(atext)
1244
+ return atext, value
1245
+
1246
+ def get_bare_quoted_string(value):
1247
+ """bare-quoted-string = DQUOTE *([FWS] qcontent) [FWS] DQUOTE
1248
+
1249
+ A quoted-string without the leading or trailing white space. Its
1250
+ value is the text between the quote marks, with whitespace
1251
+ preserved and quoted pairs decoded.
1252
+ """
1253
+ if not value or value[0] != '"':
1254
+ raise errors.HeaderParseError(
1255
+ "expected '\"' but found '{}'".format(value))
1256
+ bare_quoted_string = BareQuotedString()
1257
+ value = value[1:]
1258
+ if value and value[0] == '"':
1259
+ return bare_quoted_string, value[1:]
1260
+ while value and value[0] != '"':
1261
+ if value[0] in WSP:
1262
+ token, value = get_fws(value)
1263
+ elif value[:2] == '=?':
1264
+ valid_ew = False
1265
+ try:
1266
+ token, value = get_encoded_word(value)
1267
+ bare_quoted_string.defects.append(errors.InvalidHeaderDefect(
1268
+ "encoded word inside quoted string"))
1269
+ valid_ew = True
1270
+ except errors.HeaderParseError:
1271
+ token, value = get_qcontent(value)
1272
+ # Collapse the whitespace between two encoded words that occur in a
1273
+ # bare-quoted-string.
1274
+ if valid_ew and len(bare_quoted_string) > 1:
1275
+ if (bare_quoted_string[-1].token_type == 'fws' and
1276
+ bare_quoted_string[-2].token_type == 'encoded-word'):
1277
+ bare_quoted_string[-1] = EWWhiteSpaceTerminal(
1278
+ bare_quoted_string[-1], 'fws')
1279
+ else:
1280
+ token, value = get_qcontent(value)
1281
+ bare_quoted_string.append(token)
1282
+ if not value:
1283
+ bare_quoted_string.defects.append(errors.InvalidHeaderDefect(
1284
+ "end of header inside quoted string"))
1285
+ return bare_quoted_string, value
1286
+ return bare_quoted_string, value[1:]
1287
+
1288
+ def get_comment(value):
1289
+ """comment = "(" *([FWS] ccontent) [FWS] ")"
1290
+ ccontent = ctext / quoted-pair / comment
1291
+
1292
+ We handle nested comments here, and quoted-pair in our qp-ctext routine.
1293
+ """
1294
+ if value and value[0] != '(':
1295
+ raise errors.HeaderParseError(
1296
+ "expected '(' but found '{}'".format(value))
1297
+ comment = Comment()
1298
+ value = value[1:]
1299
+ while value and value[0] != ")":
1300
+ if value[0] in WSP:
1301
+ token, value = get_fws(value)
1302
+ elif value[0] == '(':
1303
+ token, value = get_comment(value)
1304
+ else:
1305
+ token, value = get_qp_ctext(value)
1306
+ comment.append(token)
1307
+ if not value:
1308
+ comment.defects.append(errors.InvalidHeaderDefect(
1309
+ "end of header inside comment"))
1310
+ return comment, value
1311
+ return comment, value[1:]
1312
+
1313
+ def get_cfws(value):
1314
+ """CFWS = (1*([FWS] comment) [FWS]) / FWS
1315
+
1316
+ """
1317
+ cfws = CFWSList()
1318
+ while value and value[0] in CFWS_LEADER:
1319
+ if value[0] in WSP:
1320
+ token, value = get_fws(value)
1321
+ else:
1322
+ token, value = get_comment(value)
1323
+ cfws.append(token)
1324
+ return cfws, value
1325
+
1326
+ def get_quoted_string(value):
1327
+ """quoted-string = [CFWS] <bare-quoted-string> [CFWS]
1328
+
1329
+ 'bare-quoted-string' is an intermediate class defined by this
1330
+ parser and not by the RFC grammar. It is the quoted string
1331
+ without any attached CFWS.
1332
+ """
1333
+ quoted_string = QuotedString()
1334
+ if value and value[0] in CFWS_LEADER:
1335
+ token, value = get_cfws(value)
1336
+ quoted_string.append(token)
1337
+ token, value = get_bare_quoted_string(value)
1338
+ quoted_string.append(token)
1339
+ if value and value[0] in CFWS_LEADER:
1340
+ token, value = get_cfws(value)
1341
+ quoted_string.append(token)
1342
+ return quoted_string, value
1343
+
1344
+ def get_atom(value):
1345
+ """atom = [CFWS] 1*atext [CFWS]
1346
+
1347
+ An atom could be an rfc2047 encoded word.
1348
+ """
1349
+ atom = Atom()
1350
+ if value and value[0] in CFWS_LEADER:
1351
+ token, value = get_cfws(value)
1352
+ atom.append(token)
1353
+ if value and value[0] in ATOM_ENDS:
1354
+ raise errors.HeaderParseError(
1355
+ "expected atom but found '{}'".format(value))
1356
+ if value.startswith('=?'):
1357
+ try:
1358
+ token, value = get_encoded_word(value)
1359
+ except errors.HeaderParseError:
1360
+ # XXX: need to figure out how to register defects when
1361
+ # appropriate here.
1362
+ token, value = get_atext(value)
1363
+ else:
1364
+ token, value = get_atext(value)
1365
+ atom.append(token)
1366
+ if value and value[0] in CFWS_LEADER:
1367
+ token, value = get_cfws(value)
1368
+ atom.append(token)
1369
+ return atom, value
1370
+
1371
+ def get_dot_atom_text(value):
1372
+ """ dot-text = 1*atext *("." 1*atext)
1373
+
1374
+ """
1375
+ dot_atom_text = DotAtomText()
1376
+ if not value or value[0] in ATOM_ENDS:
1377
+ raise errors.HeaderParseError("expected atom at a start of "
1378
+ "dot-atom-text but found '{}'".format(value))
1379
+ while value and value[0] not in ATOM_ENDS:
1380
+ token, value = get_atext(value)
1381
+ dot_atom_text.append(token)
1382
+ if value and value[0] == '.':
1383
+ dot_atom_text.append(DOT)
1384
+ value = value[1:]
1385
+ if dot_atom_text[-1] is DOT:
1386
+ raise errors.HeaderParseError("expected atom at end of dot-atom-text "
1387
+ "but found '{}'".format('.'+value))
1388
+ return dot_atom_text, value
1389
+
1390
+ def get_dot_atom(value):
1391
+ """ dot-atom = [CFWS] dot-atom-text [CFWS]
1392
+
1393
+ Any place we can have a dot atom, we could instead have an rfc2047 encoded
1394
+ word.
1395
+ """
1396
+ dot_atom = DotAtom()
1397
+ if value[0] in CFWS_LEADER:
1398
+ token, value = get_cfws(value)
1399
+ dot_atom.append(token)
1400
+ if value.startswith('=?'):
1401
+ try:
1402
+ token, value = get_encoded_word(value)
1403
+ except errors.HeaderParseError:
1404
+ # XXX: need to figure out how to register defects when
1405
+ # appropriate here.
1406
+ token, value = get_dot_atom_text(value)
1407
+ else:
1408
+ token, value = get_dot_atom_text(value)
1409
+ dot_atom.append(token)
1410
+ if value and value[0] in CFWS_LEADER:
1411
+ token, value = get_cfws(value)
1412
+ dot_atom.append(token)
1413
+ return dot_atom, value
1414
+
1415
+ def get_word(value):
1416
+ """word = atom / quoted-string
1417
+
1418
+ Either atom or quoted-string may start with CFWS. We have to peel off this
1419
+ CFWS first to determine which type of word to parse. Afterward we splice
1420
+ the leading CFWS, if any, into the parsed sub-token.
1421
+
1422
+ If neither an atom or a quoted-string is found before the next special, a
1423
+ HeaderParseError is raised.
1424
+
1425
+ The token returned is either an Atom or a QuotedString, as appropriate.
1426
+ This means the 'word' level of the formal grammar is not represented in the
1427
+ parse tree; this is because having that extra layer when manipulating the
1428
+ parse tree is more confusing than it is helpful.
1429
+
1430
+ """
1431
+ if value[0] in CFWS_LEADER:
1432
+ leader, value = get_cfws(value)
1433
+ else:
1434
+ leader = None
1435
+ if not value:
1436
+ raise errors.HeaderParseError(
1437
+ "Expected 'atom' or 'quoted-string' but found nothing.")
1438
+ if value[0]=='"':
1439
+ token, value = get_quoted_string(value)
1440
+ elif value[0] in SPECIALS:
1441
+ raise errors.HeaderParseError("Expected 'atom' or 'quoted-string' "
1442
+ "but found '{}'".format(value))
1443
+ else:
1444
+ token, value = get_atom(value)
1445
+ if leader is not None:
1446
+ token[:0] = [leader]
1447
+ return token, value
1448
+
1449
+ def get_phrase(value):
1450
+ """ phrase = 1*word / obs-phrase
1451
+ obs-phrase = word *(word / "." / CFWS)
1452
+
1453
+ This means a phrase can be a sequence of words, periods, and CFWS in any
1454
+ order as long as it starts with at least one word. If anything other than
1455
+ words is detected, an ObsoleteHeaderDefect is added to the token's defect
1456
+ list. We also accept a phrase that starts with CFWS followed by a dot;
1457
+ this is registered as an InvalidHeaderDefect, since it is not supported by
1458
+ even the obsolete grammar.
1459
+
1460
+ """
1461
+ phrase = Phrase()
1462
+ try:
1463
+ token, value = get_word(value)
1464
+ phrase.append(token)
1465
+ except errors.HeaderParseError:
1466
+ phrase.defects.append(errors.InvalidHeaderDefect(
1467
+ "phrase does not start with word"))
1468
+ while value and value[0] not in PHRASE_ENDS:
1469
+ if value[0]=='.':
1470
+ phrase.append(DOT)
1471
+ phrase.defects.append(errors.ObsoleteHeaderDefect(
1472
+ "period in 'phrase'"))
1473
+ value = value[1:]
1474
+ else:
1475
+ try:
1476
+ token, value = get_word(value)
1477
+ if (token[0].token_type == 'encoded-word'
1478
+ and phrase
1479
+ and phrase[-1].token_type == 'atom'
1480
+ and len(phrase[-1]) > 1
1481
+ and phrase[-1][-2].token_type == 'encoded-word'
1482
+ and phrase[-1][-1].token_type == 'cfws'
1483
+ and not phrase[-1][-1].comments
1484
+ ):
1485
+ # linear ws between ews needs special handing...
1486
+ phrase[-1][-1] = EWWhiteSpaceTerminal(phrase[-1], 'fws')
1487
+ except errors.HeaderParseError:
1488
+ if value[0] in CFWS_LEADER:
1489
+ token, value = get_cfws(value)
1490
+ phrase.defects.append(errors.ObsoleteHeaderDefect(
1491
+ "comment found without atom"))
1492
+ else:
1493
+ raise
1494
+ phrase.append(token)
1495
+ return phrase, value
1496
+
1497
+ def get_local_part(value):
1498
+ """ local-part = dot-atom / quoted-string / obs-local-part
1499
+
1500
+ """
1501
+ local_part = LocalPart()
1502
+ leader = None
1503
+ if value and value[0] in CFWS_LEADER:
1504
+ leader, value = get_cfws(value)
1505
+ if not value:
1506
+ raise errors.HeaderParseError(
1507
+ "expected local-part but found '{}'".format(value))
1508
+ try:
1509
+ token, value = get_dot_atom(value)
1510
+ except errors.HeaderParseError:
1511
+ try:
1512
+ token, value = get_word(value)
1513
+ except errors.HeaderParseError:
1514
+ if value[0] != '\\' and value[0] in PHRASE_ENDS:
1515
+ raise
1516
+ token = TokenList()
1517
+ if leader is not None:
1518
+ token[:0] = [leader]
1519
+ local_part.append(token)
1520
+ if value and (value[0]=='\\' or value[0] not in PHRASE_ENDS):
1521
+ obs_local_part, value = get_obs_local_part(str(local_part) + value)
1522
+ if obs_local_part.token_type == 'invalid-obs-local-part':
1523
+ local_part.defects.append(errors.InvalidHeaderDefect(
1524
+ "local-part is not dot-atom, quoted-string, or obs-local-part"))
1525
+ else:
1526
+ local_part.defects.append(errors.ObsoleteHeaderDefect(
1527
+ "local-part is not a dot-atom (contains CFWS)"))
1528
+ local_part[0] = obs_local_part
1529
+ try:
1530
+ local_part.value.encode('ascii')
1531
+ except UnicodeEncodeError:
1532
+ local_part.defects.append(errors.NonASCIILocalPartDefect(
1533
+ "local-part contains non-ASCII characters)"))
1534
+ return local_part, value
1535
+
1536
+ def get_obs_local_part(value):
1537
+ """ obs-local-part = word *("." word)
1538
+ """
1539
+ obs_local_part = ObsLocalPart()
1540
+ last_non_ws_was_dot = False
1541
+ while value and (value[0]=='\\' or value[0] not in PHRASE_ENDS):
1542
+ if value[0] == '.':
1543
+ if last_non_ws_was_dot:
1544
+ obs_local_part.defects.append(errors.InvalidHeaderDefect(
1545
+ "invalid repeated '.'"))
1546
+ obs_local_part.append(DOT)
1547
+ last_non_ws_was_dot = True
1548
+ value = value[1:]
1549
+ continue
1550
+ elif value[0]=='\\':
1551
+ obs_local_part.append(ValueTerminal(value[0],
1552
+ 'misplaced-special'))
1553
+ value = value[1:]
1554
+ obs_local_part.defects.append(errors.InvalidHeaderDefect(
1555
+ "'\\' character outside of quoted-string/ccontent"))
1556
+ last_non_ws_was_dot = False
1557
+ continue
1558
+ if obs_local_part and obs_local_part[-1].token_type != 'dot':
1559
+ obs_local_part.defects.append(errors.InvalidHeaderDefect(
1560
+ "missing '.' between words"))
1561
+ try:
1562
+ token, value = get_word(value)
1563
+ last_non_ws_was_dot = False
1564
+ except errors.HeaderParseError:
1565
+ if value[0] not in CFWS_LEADER:
1566
+ raise
1567
+ token, value = get_cfws(value)
1568
+ obs_local_part.append(token)
1569
+ if not obs_local_part:
1570
+ raise errors.HeaderParseError(
1571
+ "expected obs-local-part but found '{}'".format(value))
1572
+ if (obs_local_part[0].token_type == 'dot' or
1573
+ obs_local_part[0].token_type=='cfws' and
1574
+ len(obs_local_part) > 1 and
1575
+ obs_local_part[1].token_type=='dot'):
1576
+ obs_local_part.defects.append(errors.InvalidHeaderDefect(
1577
+ "Invalid leading '.' in local part"))
1578
+ if (obs_local_part[-1].token_type == 'dot' or
1579
+ obs_local_part[-1].token_type=='cfws' and
1580
+ len(obs_local_part) > 1 and
1581
+ obs_local_part[-2].token_type=='dot'):
1582
+ obs_local_part.defects.append(errors.InvalidHeaderDefect(
1583
+ "Invalid trailing '.' in local part"))
1584
+ if obs_local_part.defects:
1585
+ obs_local_part.token_type = 'invalid-obs-local-part'
1586
+ return obs_local_part, value
1587
+
1588
+ def get_dtext(value):
1589
+ r""" dtext = <printable ascii except \ [ ]> / obs-dtext
1590
+ obs-dtext = obs-NO-WS-CTL / quoted-pair
1591
+
1592
+ We allow anything except the excluded characters, but if we find any
1593
+ ASCII other than the RFC defined printable ASCII, a NonPrintableDefect is
1594
+ added to the token's defects list. Quoted pairs are converted to their
1595
+ unquoted values, so what is returned is a ptext token, in this case a
1596
+ ValueTerminal. If there were quoted-printables, an ObsoleteHeaderDefect is
1597
+ added to the returned token's defect list.
1598
+
1599
+ """
1600
+ ptext, value, had_qp = _get_ptext_to_endchars(value, '[]')
1601
+ ptext = ValueTerminal(ptext, 'ptext')
1602
+ if had_qp:
1603
+ ptext.defects.append(errors.ObsoleteHeaderDefect(
1604
+ "quoted printable found in domain-literal"))
1605
+ _validate_xtext(ptext)
1606
+ return ptext, value
1607
+
1608
+ def _check_for_early_dl_end(value, domain_literal):
1609
+ if value:
1610
+ return False
1611
+ domain_literal.defects.append(errors.InvalidHeaderDefect(
1612
+ "end of input inside domain-literal"))
1613
+ domain_literal.append(ValueTerminal(']', 'domain-literal-end'))
1614
+ return True
1615
+
1616
+ def get_domain_literal(value):
1617
+ """ domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
1618
+
1619
+ """
1620
+ domain_literal = DomainLiteral()
1621
+ if value[0] in CFWS_LEADER:
1622
+ token, value = get_cfws(value)
1623
+ domain_literal.append(token)
1624
+ if not value:
1625
+ raise errors.HeaderParseError("expected domain-literal")
1626
+ if value[0] != '[':
1627
+ raise errors.HeaderParseError("expected '[' at start of domain-literal "
1628
+ "but found '{}'".format(value))
1629
+ value = value[1:]
1630
+ domain_literal.append(ValueTerminal('[', 'domain-literal-start'))
1631
+ if _check_for_early_dl_end(value, domain_literal):
1632
+ return domain_literal, value
1633
+ if value[0] in WSP:
1634
+ token, value = get_fws(value)
1635
+ domain_literal.append(token)
1636
+ token, value = get_dtext(value)
1637
+ domain_literal.append(token)
1638
+ if _check_for_early_dl_end(value, domain_literal):
1639
+ return domain_literal, value
1640
+ if value[0] in WSP:
1641
+ token, value = get_fws(value)
1642
+ domain_literal.append(token)
1643
+ if _check_for_early_dl_end(value, domain_literal):
1644
+ return domain_literal, value
1645
+ if value[0] != ']':
1646
+ raise errors.HeaderParseError("expected ']' at end of domain-literal "
1647
+ "but found '{}'".format(value))
1648
+ domain_literal.append(ValueTerminal(']', 'domain-literal-end'))
1649
+ value = value[1:]
1650
+ if value and value[0] in CFWS_LEADER:
1651
+ token, value = get_cfws(value)
1652
+ domain_literal.append(token)
1653
+ return domain_literal, value
1654
+
1655
+ def get_domain(value):
1656
+ """ domain = dot-atom / domain-literal / obs-domain
1657
+ obs-domain = atom *("." atom))
1658
+
1659
+ """
1660
+ domain = Domain()
1661
+ leader = None
1662
+ if value and value[0] in CFWS_LEADER:
1663
+ leader, value = get_cfws(value)
1664
+ if not value:
1665
+ raise errors.HeaderParseError(
1666
+ "expected domain but found '{}'".format(value))
1667
+ if value[0] == '[':
1668
+ token, value = get_domain_literal(value)
1669
+ if leader is not None:
1670
+ token[:0] = [leader]
1671
+ domain.append(token)
1672
+ return domain, value
1673
+ try:
1674
+ token, value = get_dot_atom(value)
1675
+ except errors.HeaderParseError:
1676
+ token, value = get_atom(value)
1677
+ if value and value[0] == '@':
1678
+ raise errors.HeaderParseError('Invalid Domain')
1679
+ if leader is not None:
1680
+ token[:0] = [leader]
1681
+ domain.append(token)
1682
+ if value and value[0] == '.':
1683
+ domain.defects.append(errors.ObsoleteHeaderDefect(
1684
+ "domain is not a dot-atom (contains CFWS)"))
1685
+ if domain[0].token_type == 'dot-atom':
1686
+ domain[:] = domain[0]
1687
+ while value and value[0] == '.':
1688
+ domain.append(DOT)
1689
+ token, value = get_atom(value[1:])
1690
+ domain.append(token)
1691
+ return domain, value
1692
+
1693
+ def get_addr_spec(value):
1694
+ """ addr-spec = local-part "@" domain
1695
+
1696
+ """
1697
+ addr_spec = AddrSpec()
1698
+ token, value = get_local_part(value)
1699
+ addr_spec.append(token)
1700
+ if not value or value[0] != '@':
1701
+ addr_spec.defects.append(errors.InvalidHeaderDefect(
1702
+ "addr-spec local part with no domain"))
1703
+ return addr_spec, value
1704
+ addr_spec.append(ValueTerminal('@', 'address-at-symbol'))
1705
+ token, value = get_domain(value[1:])
1706
+ addr_spec.append(token)
1707
+ return addr_spec, value
1708
+
1709
+ def get_obs_route(value):
1710
+ """ obs-route = obs-domain-list ":"
1711
+ obs-domain-list = *(CFWS / ",") "@" domain *("," [CFWS] ["@" domain])
1712
+
1713
+ Returns an obs-route token with the appropriate sub-tokens (that is,
1714
+ there is no obs-domain-list in the parse tree).
1715
+ """
1716
+ obs_route = ObsRoute()
1717
+ while value and (value[0]==',' or value[0] in CFWS_LEADER):
1718
+ if value[0] in CFWS_LEADER:
1719
+ token, value = get_cfws(value)
1720
+ obs_route.append(token)
1721
+ elif value[0] == ',':
1722
+ obs_route.append(ListSeparator)
1723
+ value = value[1:]
1724
+ if not value or value[0] != '@':
1725
+ raise errors.HeaderParseError(
1726
+ "expected obs-route domain but found '{}'".format(value))
1727
+ obs_route.append(RouteComponentMarker)
1728
+ token, value = get_domain(value[1:])
1729
+ obs_route.append(token)
1730
+ while value and value[0]==',':
1731
+ obs_route.append(ListSeparator)
1732
+ value = value[1:]
1733
+ if not value:
1734
+ break
1735
+ if value[0] in CFWS_LEADER:
1736
+ token, value = get_cfws(value)
1737
+ obs_route.append(token)
1738
+ if not value:
1739
+ break
1740
+ if value[0] == '@':
1741
+ obs_route.append(RouteComponentMarker)
1742
+ token, value = get_domain(value[1:])
1743
+ obs_route.append(token)
1744
+ if not value:
1745
+ raise errors.HeaderParseError("end of header while parsing obs-route")
1746
+ if value[0] != ':':
1747
+ raise errors.HeaderParseError( "expected ':' marking end of "
1748
+ "obs-route but found '{}'".format(value))
1749
+ obs_route.append(ValueTerminal(':', 'end-of-obs-route-marker'))
1750
+ return obs_route, value[1:]
1751
+
1752
+ def get_angle_addr(value):
1753
+ """ angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr
1754
+ obs-angle-addr = [CFWS] "<" obs-route addr-spec ">" [CFWS]
1755
+
1756
+ """
1757
+ angle_addr = AngleAddr()
1758
+ if value and value[0] in CFWS_LEADER:
1759
+ token, value = get_cfws(value)
1760
+ angle_addr.append(token)
1761
+ if not value or value[0] != '<':
1762
+ raise errors.HeaderParseError(
1763
+ "expected angle-addr but found '{}'".format(value))
1764
+ angle_addr.append(ValueTerminal('<', 'angle-addr-start'))
1765
+ value = value[1:]
1766
+ # Although it is not legal per RFC5322, SMTP uses '<>' in certain
1767
+ # circumstances.
1768
+ if value and value[0] == '>':
1769
+ angle_addr.append(ValueTerminal('>', 'angle-addr-end'))
1770
+ angle_addr.defects.append(errors.InvalidHeaderDefect(
1771
+ "null addr-spec in angle-addr"))
1772
+ value = value[1:]
1773
+ return angle_addr, value
1774
+ try:
1775
+ token, value = get_addr_spec(value)
1776
+ except errors.HeaderParseError:
1777
+ try:
1778
+ token, value = get_obs_route(value)
1779
+ angle_addr.defects.append(errors.ObsoleteHeaderDefect(
1780
+ "obsolete route specification in angle-addr"))
1781
+ except errors.HeaderParseError:
1782
+ raise errors.HeaderParseError(
1783
+ "expected addr-spec or obs-route but found '{}'".format(value))
1784
+ angle_addr.append(token)
1785
+ token, value = get_addr_spec(value)
1786
+ angle_addr.append(token)
1787
+ if value and value[0] == '>':
1788
+ value = value[1:]
1789
+ else:
1790
+ angle_addr.defects.append(errors.InvalidHeaderDefect(
1791
+ "missing trailing '>' on angle-addr"))
1792
+ angle_addr.append(ValueTerminal('>', 'angle-addr-end'))
1793
+ if value and value[0] in CFWS_LEADER:
1794
+ token, value = get_cfws(value)
1795
+ angle_addr.append(token)
1796
+ return angle_addr, value
1797
+
1798
+ def get_display_name(value):
1799
+ """ display-name = phrase
1800
+
1801
+ Because this is simply a name-rule, we don't return a display-name
1802
+ token containing a phrase, but rather a display-name token with
1803
+ the content of the phrase.
1804
+
1805
+ """
1806
+ display_name = DisplayName()
1807
+ token, value = get_phrase(value)
1808
+ display_name.extend(token[:])
1809
+ display_name.defects = token.defects[:]
1810
+ return display_name, value
1811
+
1812
+
1813
+ def get_name_addr(value):
1814
+ """ name-addr = [display-name] angle-addr
1815
+
1816
+ """
1817
+ name_addr = NameAddr()
1818
+ # Both the optional display name and the angle-addr can start with cfws.
1819
+ leader = None
1820
+ if not value:
1821
+ raise errors.HeaderParseError(
1822
+ "expected name-addr but found '{}'".format(value))
1823
+ if value[0] in CFWS_LEADER:
1824
+ leader, value = get_cfws(value)
1825
+ if not value:
1826
+ raise errors.HeaderParseError(
1827
+ "expected name-addr but found '{}'".format(leader))
1828
+ if value[0] != '<':
1829
+ if value[0] in PHRASE_ENDS:
1830
+ raise errors.HeaderParseError(
1831
+ "expected name-addr but found '{}'".format(value))
1832
+ token, value = get_display_name(value)
1833
+ if not value:
1834
+ raise errors.HeaderParseError(
1835
+ "expected name-addr but found '{}'".format(token))
1836
+ if leader is not None:
1837
+ if isinstance(token[0], TokenList):
1838
+ token[0][:0] = [leader]
1839
+ else:
1840
+ token[:0] = [leader]
1841
+ leader = None
1842
+ name_addr.append(token)
1843
+ token, value = get_angle_addr(value)
1844
+ if leader is not None:
1845
+ token[:0] = [leader]
1846
+ name_addr.append(token)
1847
+ return name_addr, value
1848
+
1849
+ def get_mailbox(value):
1850
+ """ mailbox = name-addr / addr-spec
1851
+
1852
+ """
1853
+ # The only way to figure out if we are dealing with a name-addr or an
1854
+ # addr-spec is to try parsing each one.
1855
+ mailbox = Mailbox()
1856
+ try:
1857
+ token, value = get_name_addr(value)
1858
+ except errors.HeaderParseError:
1859
+ try:
1860
+ token, value = get_addr_spec(value)
1861
+ except errors.HeaderParseError:
1862
+ raise errors.HeaderParseError(
1863
+ "expected mailbox but found '{}'".format(value))
1864
+ if any(isinstance(x, errors.InvalidHeaderDefect)
1865
+ for x in token.all_defects):
1866
+ mailbox.token_type = 'invalid-mailbox'
1867
+ mailbox.append(token)
1868
+ return mailbox, value
1869
+
1870
+ def get_invalid_mailbox(value, endchars):
1871
+ """ Read everything up to one of the chars in endchars.
1872
+
1873
+ This is outside the formal grammar. The InvalidMailbox TokenList that is
1874
+ returned acts like a Mailbox, but the data attributes are None.
1875
+
1876
+ """
1877
+ invalid_mailbox = InvalidMailbox()
1878
+ while value and value[0] not in endchars:
1879
+ if value[0] in PHRASE_ENDS:
1880
+ invalid_mailbox.append(ValueTerminal(value[0],
1881
+ 'misplaced-special'))
1882
+ value = value[1:]
1883
+ else:
1884
+ token, value = get_phrase(value)
1885
+ invalid_mailbox.append(token)
1886
+ return invalid_mailbox, value
1887
+
1888
+ def get_mailbox_list(value):
1889
+ """ mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list
1890
+ obs-mbox-list = *([CFWS] ",") mailbox *("," [mailbox / CFWS])
1891
+
1892
+ For this routine we go outside the formal grammar in order to improve error
1893
+ handling. We recognize the end of the mailbox list only at the end of the
1894
+ value or at a ';' (the group terminator). This is so that we can turn
1895
+ invalid mailboxes into InvalidMailbox tokens and continue parsing any
1896
+ remaining valid mailboxes. We also allow all mailbox entries to be null,
1897
+ and this condition is handled appropriately at a higher level.
1898
+
1899
+ """
1900
+ mailbox_list = MailboxList()
1901
+ while value and value[0] != ';':
1902
+ try:
1903
+ token, value = get_mailbox(value)
1904
+ mailbox_list.append(token)
1905
+ except errors.HeaderParseError:
1906
+ leader = None
1907
+ if value[0] in CFWS_LEADER:
1908
+ leader, value = get_cfws(value)
1909
+ if not value or value[0] in ',;':
1910
+ mailbox_list.append(leader)
1911
+ mailbox_list.defects.append(errors.ObsoleteHeaderDefect(
1912
+ "empty element in mailbox-list"))
1913
+ else:
1914
+ token, value = get_invalid_mailbox(value, ',;')
1915
+ if leader is not None:
1916
+ token[:0] = [leader]
1917
+ mailbox_list.append(token)
1918
+ mailbox_list.defects.append(errors.InvalidHeaderDefect(
1919
+ "invalid mailbox in mailbox-list"))
1920
+ elif value[0] == ',':
1921
+ mailbox_list.defects.append(errors.ObsoleteHeaderDefect(
1922
+ "empty element in mailbox-list"))
1923
+ else:
1924
+ token, value = get_invalid_mailbox(value, ',;')
1925
+ if leader is not None:
1926
+ token[:0] = [leader]
1927
+ mailbox_list.append(token)
1928
+ mailbox_list.defects.append(errors.InvalidHeaderDefect(
1929
+ "invalid mailbox in mailbox-list"))
1930
+ if value and value[0] not in ',;':
1931
+ # Crap after mailbox; treat it as an invalid mailbox.
1932
+ # The mailbox info will still be available.
1933
+ mailbox = mailbox_list[-1]
1934
+ mailbox.token_type = 'invalid-mailbox'
1935
+ token, value = get_invalid_mailbox(value, ',;')
1936
+ mailbox.extend(token)
1937
+ mailbox_list.defects.append(errors.InvalidHeaderDefect(
1938
+ "invalid mailbox in mailbox-list"))
1939
+ if value and value[0] == ',':
1940
+ mailbox_list.append(ListSeparator)
1941
+ value = value[1:]
1942
+ return mailbox_list, value
1943
+
1944
+
1945
+ def get_group_list(value):
1946
+ """ group-list = mailbox-list / CFWS / obs-group-list
1947
+ obs-group-list = 1*([CFWS] ",") [CFWS]
1948
+
1949
+ """
1950
+ group_list = GroupList()
1951
+ if not value:
1952
+ group_list.defects.append(errors.InvalidHeaderDefect(
1953
+ "end of header before group-list"))
1954
+ return group_list, value
1955
+ leader = None
1956
+ if value and value[0] in CFWS_LEADER:
1957
+ leader, value = get_cfws(value)
1958
+ if not value:
1959
+ # This should never happen in email parsing, since CFWS-only is a
1960
+ # legal alternative to group-list in a group, which is the only
1961
+ # place group-list appears.
1962
+ group_list.defects.append(errors.InvalidHeaderDefect(
1963
+ "end of header in group-list"))
1964
+ group_list.append(leader)
1965
+ return group_list, value
1966
+ if value[0] == ';':
1967
+ group_list.append(leader)
1968
+ return group_list, value
1969
+ token, value = get_mailbox_list(value)
1970
+ if len(token.all_mailboxes)==0:
1971
+ if leader is not None:
1972
+ group_list.append(leader)
1973
+ group_list.extend(token)
1974
+ group_list.defects.append(errors.ObsoleteHeaderDefect(
1975
+ "group-list with empty entries"))
1976
+ return group_list, value
1977
+ if leader is not None:
1978
+ token[:0] = [leader]
1979
+ group_list.append(token)
1980
+ return group_list, value
1981
+
1982
+ def get_group(value):
1983
+ """ group = display-name ":" [group-list] ";" [CFWS]
1984
+
1985
+ """
1986
+ group = Group()
1987
+ token, value = get_display_name(value)
1988
+ if not value or value[0] != ':':
1989
+ raise errors.HeaderParseError("expected ':' at end of group "
1990
+ "display name but found '{}'".format(value))
1991
+ group.append(token)
1992
+ group.append(ValueTerminal(':', 'group-display-name-terminator'))
1993
+ value = value[1:]
1994
+ if value and value[0] == ';':
1995
+ group.append(ValueTerminal(';', 'group-terminator'))
1996
+ return group, value[1:]
1997
+ token, value = get_group_list(value)
1998
+ group.append(token)
1999
+ if not value:
2000
+ group.defects.append(errors.InvalidHeaderDefect(
2001
+ "end of header in group"))
2002
+ elif value[0] != ';':
2003
+ raise errors.HeaderParseError(
2004
+ "expected ';' at end of group but found {}".format(value))
2005
+ group.append(ValueTerminal(';', 'group-terminator'))
2006
+ value = value[1:]
2007
+ if value and value[0] in CFWS_LEADER:
2008
+ token, value = get_cfws(value)
2009
+ group.append(token)
2010
+ return group, value
2011
+
2012
+ def get_address(value):
2013
+ """ address = mailbox / group
2014
+
2015
+ Note that counter-intuitively, an address can be either a single address or
2016
+ a list of addresses (a group). This is why the returned Address object has
2017
+ a 'mailboxes' attribute which treats a single address as a list of length
2018
+ one. When you need to differentiate between to two cases, extract the single
2019
+ element, which is either a mailbox or a group token.
2020
+
2021
+ """
2022
+ # The formal grammar isn't very helpful when parsing an address. mailbox
2023
+ # and group, especially when allowing for obsolete forms, start off very
2024
+ # similarly. It is only when you reach one of @, <, or : that you know
2025
+ # what you've got. So, we try each one in turn, starting with the more
2026
+ # likely of the two. We could perhaps make this more efficient by looking
2027
+ # for a phrase and then branching based on the next character, but that
2028
+ # would be a premature optimization.
2029
+ address = Address()
2030
+ try:
2031
+ token, value = get_group(value)
2032
+ except errors.HeaderParseError:
2033
+ try:
2034
+ token, value = get_mailbox(value)
2035
+ except errors.HeaderParseError:
2036
+ raise errors.HeaderParseError(
2037
+ "expected address but found '{}'".format(value))
2038
+ address.append(token)
2039
+ return address, value
2040
+
2041
+ def get_address_list(value):
2042
+ """ address_list = (address *("," address)) / obs-addr-list
2043
+ obs-addr-list = *([CFWS] ",") address *("," [address / CFWS])
2044
+
2045
+ We depart from the formal grammar here by continuing to parse until the end
2046
+ of the input, assuming the input to be entirely composed of an
2047
+ address-list. This is always true in email parsing, and allows us
2048
+ to skip invalid addresses to parse additional valid ones.
2049
+
2050
+ """
2051
+ address_list = AddressList()
2052
+ while value:
2053
+ try:
2054
+ token, value = get_address(value)
2055
+ address_list.append(token)
2056
+ except errors.HeaderParseError:
2057
+ leader = None
2058
+ if value[0] in CFWS_LEADER:
2059
+ leader, value = get_cfws(value)
2060
+ if not value or value[0] == ',':
2061
+ address_list.append(leader)
2062
+ address_list.defects.append(errors.ObsoleteHeaderDefect(
2063
+ "address-list entry with no content"))
2064
+ else:
2065
+ token, value = get_invalid_mailbox(value, ',')
2066
+ if leader is not None:
2067
+ token[:0] = [leader]
2068
+ address_list.append(Address([token]))
2069
+ address_list.defects.append(errors.InvalidHeaderDefect(
2070
+ "invalid address in address-list"))
2071
+ elif value[0] == ',':
2072
+ address_list.defects.append(errors.ObsoleteHeaderDefect(
2073
+ "empty element in address-list"))
2074
+ else:
2075
+ token, value = get_invalid_mailbox(value, ',')
2076
+ if leader is not None:
2077
+ token[:0] = [leader]
2078
+ address_list.append(Address([token]))
2079
+ address_list.defects.append(errors.InvalidHeaderDefect(
2080
+ "invalid address in address-list"))
2081
+ if value and value[0] != ',':
2082
+ # Crap after address: add it to the address list
2083
+ # as an invalid mailbox
2084
+ token, value = get_invalid_mailbox(value, ',')
2085
+ address_list.append(Address([token]))
2086
+ address_list.defects.append(errors.InvalidHeaderDefect(
2087
+ "invalid address in address-list"))
2088
+ if value: # Must be a , at this point.
2089
+ address_list.append(ListSeparator)
2090
+ value = value[1:]
2091
+ return address_list, value
2092
+
2093
+
2094
+ def get_no_fold_literal(value):
2095
+ """ no-fold-literal = "[" *dtext "]"
2096
+ """
2097
+ no_fold_literal = NoFoldLiteral()
2098
+ if not value:
2099
+ raise errors.HeaderParseError(
2100
+ "expected no-fold-literal but found '{}'".format(value))
2101
+ if value[0] != '[':
2102
+ raise errors.HeaderParseError(
2103
+ "expected '[' at the start of no-fold-literal "
2104
+ "but found '{}'".format(value))
2105
+ no_fold_literal.append(ValueTerminal('[', 'no-fold-literal-start'))
2106
+ value = value[1:]
2107
+ token, value = get_dtext(value)
2108
+ no_fold_literal.append(token)
2109
+ if not value or value[0] != ']':
2110
+ raise errors.HeaderParseError(
2111
+ "expected ']' at the end of no-fold-literal "
2112
+ "but found '{}'".format(value))
2113
+ no_fold_literal.append(ValueTerminal(']', 'no-fold-literal-end'))
2114
+ return no_fold_literal, value[1:]
2115
+
2116
+ def get_msg_id(value):
2117
+ """msg-id = [CFWS] "<" id-left '@' id-right ">" [CFWS]
2118
+ id-left = dot-atom-text / obs-id-left
2119
+ id-right = dot-atom-text / no-fold-literal / obs-id-right
2120
+ no-fold-literal = "[" *dtext "]"
2121
+ """
2122
+ msg_id = MsgID()
2123
+ if value and value[0] in CFWS_LEADER:
2124
+ token, value = get_cfws(value)
2125
+ msg_id.append(token)
2126
+ if not value or value[0] != '<':
2127
+ raise errors.HeaderParseError(
2128
+ "expected msg-id but found '{}'".format(value))
2129
+ msg_id.append(ValueTerminal('<', 'msg-id-start'))
2130
+ value = value[1:]
2131
+ # Parse id-left.
2132
+ try:
2133
+ token, value = get_dot_atom_text(value)
2134
+ except errors.HeaderParseError:
2135
+ try:
2136
+ # obs-id-left is same as local-part of add-spec.
2137
+ token, value = get_obs_local_part(value)
2138
+ msg_id.defects.append(errors.ObsoleteHeaderDefect(
2139
+ "obsolete id-left in msg-id"))
2140
+ except errors.HeaderParseError:
2141
+ raise errors.HeaderParseError(
2142
+ "expected dot-atom-text or obs-id-left"
2143
+ " but found '{}'".format(value))
2144
+ msg_id.append(token)
2145
+ if not value or value[0] != '@':
2146
+ msg_id.defects.append(errors.InvalidHeaderDefect(
2147
+ "msg-id with no id-right"))
2148
+ # Even though there is no id-right, if the local part
2149
+ # ends with `>` let's just parse it too and return
2150
+ # along with the defect.
2151
+ if value and value[0] == '>':
2152
+ msg_id.append(ValueTerminal('>', 'msg-id-end'))
2153
+ value = value[1:]
2154
+ return msg_id, value
2155
+ msg_id.append(ValueTerminal('@', 'address-at-symbol'))
2156
+ value = value[1:]
2157
+ # Parse id-right.
2158
+ try:
2159
+ token, value = get_dot_atom_text(value)
2160
+ except errors.HeaderParseError:
2161
+ try:
2162
+ token, value = get_no_fold_literal(value)
2163
+ except errors.HeaderParseError:
2164
+ try:
2165
+ token, value = get_domain(value)
2166
+ msg_id.defects.append(errors.ObsoleteHeaderDefect(
2167
+ "obsolete id-right in msg-id"))
2168
+ except errors.HeaderParseError:
2169
+ raise errors.HeaderParseError(
2170
+ "expected dot-atom-text, no-fold-literal or obs-id-right"
2171
+ " but found '{}'".format(value))
2172
+ msg_id.append(token)
2173
+ if value and value[0] == '>':
2174
+ value = value[1:]
2175
+ else:
2176
+ msg_id.defects.append(errors.InvalidHeaderDefect(
2177
+ "missing trailing '>' on msg-id"))
2178
+ msg_id.append(ValueTerminal('>', 'msg-id-end'))
2179
+ if value and value[0] in CFWS_LEADER:
2180
+ token, value = get_cfws(value)
2181
+ msg_id.append(token)
2182
+ return msg_id, value
2183
+
2184
+
2185
+ def parse_message_id(value):
2186
+ """message-id = "Message-ID:" msg-id CRLF
2187
+ """
2188
+ message_id = MessageID()
2189
+ try:
2190
+ token, value = get_msg_id(value)
2191
+ message_id.append(token)
2192
+ except errors.HeaderParseError as ex:
2193
+ token = get_unstructured(value)
2194
+ message_id = InvalidMessageID(token)
2195
+ message_id.defects.append(
2196
+ errors.InvalidHeaderDefect("Invalid msg-id: {!r}".format(ex)))
2197
+ else:
2198
+ # Value after parsing a valid msg_id should be None.
2199
+ if value:
2200
+ message_id.defects.append(errors.InvalidHeaderDefect(
2201
+ "Unexpected {!r}".format(value)))
2202
+
2203
+ return message_id
2204
+
2205
+ def parse_message_ids(value):
2206
+ """in-reply-to = "In-Reply-To:" 1*msg-id CRLF
2207
+ references = "References:" 1*msg-id CRLF
2208
+ """
2209
+ message_id_list = MessageIDList()
2210
+ while value:
2211
+ if value[0] == ',':
2212
+ # message id list separated with commas - this is invalid,
2213
+ # but happens rather frequently in the wild
2214
+ message_id_list.defects.append(
2215
+ errors.InvalidHeaderDefect("comma in msg-id list"))
2216
+ message_id_list.append(
2217
+ WhiteSpaceTerminal(' ', 'invalid-comma-replacement'))
2218
+ value = value[1:]
2219
+ continue
2220
+ try:
2221
+ token, value = get_msg_id(value)
2222
+ message_id_list.append(token)
2223
+ except errors.HeaderParseError as ex:
2224
+ token = get_unstructured(value)
2225
+ message_id_list.append(InvalidMessageID(token))
2226
+ message_id_list.defects.append(
2227
+ errors.InvalidHeaderDefect("Invalid msg-id: {!r}".format(ex)))
2228
+ break
2229
+ return message_id_list
2230
+
2231
+ #
2232
+ # XXX: As I begin to add additional header parsers, I'm realizing we probably
2233
+ # have two level of parser routines: the get_XXX methods that get a token in
2234
+ # the grammar, and parse_XXX methods that parse an entire field value. So
2235
+ # get_address_list above should really be a parse_ method, as probably should
2236
+ # be get_unstructured.
2237
+ #
2238
+
2239
+ def parse_mime_version(value):
2240
+ """ mime-version = [CFWS] 1*digit [CFWS] "." [CFWS] 1*digit [CFWS]
2241
+
2242
+ """
2243
+ # The [CFWS] is implicit in the RFC 2045 BNF.
2244
+ # XXX: This routine is a bit verbose, should factor out a get_int method.
2245
+ mime_version = MIMEVersion()
2246
+ if not value:
2247
+ mime_version.defects.append(errors.HeaderMissingRequiredValue(
2248
+ "Missing MIME version number (eg: 1.0)"))
2249
+ return mime_version
2250
+ if value[0] in CFWS_LEADER:
2251
+ token, value = get_cfws(value)
2252
+ mime_version.append(token)
2253
+ if not value:
2254
+ mime_version.defects.append(errors.HeaderMissingRequiredValue(
2255
+ "Expected MIME version number but found only CFWS"))
2256
+ digits = ''
2257
+ while value and value[0] != '.' and value[0] not in CFWS_LEADER:
2258
+ digits += value[0]
2259
+ value = value[1:]
2260
+ if not digits.isdigit():
2261
+ mime_version.defects.append(errors.InvalidHeaderDefect(
2262
+ "Expected MIME major version number but found {!r}".format(digits)))
2263
+ mime_version.append(ValueTerminal(digits, 'xtext'))
2264
+ else:
2265
+ mime_version.major = int(digits)
2266
+ mime_version.append(ValueTerminal(digits, 'digits'))
2267
+ if value and value[0] in CFWS_LEADER:
2268
+ token, value = get_cfws(value)
2269
+ mime_version.append(token)
2270
+ if not value or value[0] != '.':
2271
+ if mime_version.major is not None:
2272
+ mime_version.defects.append(errors.InvalidHeaderDefect(
2273
+ "Incomplete MIME version; found only major number"))
2274
+ if value:
2275
+ mime_version.append(ValueTerminal(value, 'xtext'))
2276
+ return mime_version
2277
+ mime_version.append(ValueTerminal('.', 'version-separator'))
2278
+ value = value[1:]
2279
+ if value and value[0] in CFWS_LEADER:
2280
+ token, value = get_cfws(value)
2281
+ mime_version.append(token)
2282
+ if not value:
2283
+ if mime_version.major is not None:
2284
+ mime_version.defects.append(errors.InvalidHeaderDefect(
2285
+ "Incomplete MIME version; found only major number"))
2286
+ return mime_version
2287
+ digits = ''
2288
+ while value and value[0] not in CFWS_LEADER:
2289
+ digits += value[0]
2290
+ value = value[1:]
2291
+ if not digits.isdigit():
2292
+ mime_version.defects.append(errors.InvalidHeaderDefect(
2293
+ "Expected MIME minor version number but found {!r}".format(digits)))
2294
+ mime_version.append(ValueTerminal(digits, 'xtext'))
2295
+ else:
2296
+ mime_version.minor = int(digits)
2297
+ mime_version.append(ValueTerminal(digits, 'digits'))
2298
+ if value and value[0] in CFWS_LEADER:
2299
+ token, value = get_cfws(value)
2300
+ mime_version.append(token)
2301
+ if value:
2302
+ mime_version.defects.append(errors.InvalidHeaderDefect(
2303
+ "Excess non-CFWS text after MIME version"))
2304
+ mime_version.append(ValueTerminal(value, 'xtext'))
2305
+ return mime_version
2306
+
2307
+ def get_invalid_parameter(value):
2308
+ """ Read everything up to the next ';'.
2309
+
2310
+ This is outside the formal grammar. The InvalidParameter TokenList that is
2311
+ returned acts like a Parameter, but the data attributes are None.
2312
+
2313
+ """
2314
+ invalid_parameter = InvalidParameter()
2315
+ while value and value[0] != ';':
2316
+ if value[0] in PHRASE_ENDS:
2317
+ invalid_parameter.append(ValueTerminal(value[0],
2318
+ 'misplaced-special'))
2319
+ value = value[1:]
2320
+ else:
2321
+ token, value = get_phrase(value)
2322
+ invalid_parameter.append(token)
2323
+ return invalid_parameter, value
2324
+
2325
+ def get_ttext(value):
2326
+ """ttext = <matches _ttext_matcher>
2327
+
2328
+ We allow any non-TOKEN_ENDS in ttext, but add defects to the token's
2329
+ defects list if we find non-ttext characters. We also register defects for
2330
+ *any* non-printables even though the RFC doesn't exclude all of them,
2331
+ because we follow the spirit of RFC 5322.
2332
+
2333
+ """
2334
+ m = _non_token_end_matcher(value)
2335
+ if not m:
2336
+ raise errors.HeaderParseError(
2337
+ "expected ttext but found '{}'".format(value))
2338
+ ttext = m.group()
2339
+ value = value[len(ttext):]
2340
+ ttext = ValueTerminal(ttext, 'ttext')
2341
+ _validate_xtext(ttext)
2342
+ return ttext, value
2343
+
2344
+ def get_token(value):
2345
+ """token = [CFWS] 1*ttext [CFWS]
2346
+
2347
+ The RFC equivalent of ttext is any US-ASCII chars except space, ctls, or
2348
+ tspecials. We also exclude tabs even though the RFC doesn't.
2349
+
2350
+ The RFC implies the CFWS but is not explicit about it in the BNF.
2351
+
2352
+ """
2353
+ mtoken = Token()
2354
+ if value and value[0] in CFWS_LEADER:
2355
+ token, value = get_cfws(value)
2356
+ mtoken.append(token)
2357
+ if value and value[0] in TOKEN_ENDS:
2358
+ raise errors.HeaderParseError(
2359
+ "expected token but found '{}'".format(value))
2360
+ token, value = get_ttext(value)
2361
+ mtoken.append(token)
2362
+ if value and value[0] in CFWS_LEADER:
2363
+ token, value = get_cfws(value)
2364
+ mtoken.append(token)
2365
+ return mtoken, value
2366
+
2367
+ def get_attrtext(value):
2368
+ """attrtext = 1*(any non-ATTRIBUTE_ENDS character)
2369
+
2370
+ We allow any non-ATTRIBUTE_ENDS in attrtext, but add defects to the
2371
+ token's defects list if we find non-attrtext characters. We also register
2372
+ defects for *any* non-printables even though the RFC doesn't exclude all of
2373
+ them, because we follow the spirit of RFC 5322.
2374
+
2375
+ """
2376
+ m = _non_attribute_end_matcher(value)
2377
+ if not m:
2378
+ raise errors.HeaderParseError(
2379
+ "expected attrtext but found {!r}".format(value))
2380
+ attrtext = m.group()
2381
+ value = value[len(attrtext):]
2382
+ attrtext = ValueTerminal(attrtext, 'attrtext')
2383
+ _validate_xtext(attrtext)
2384
+ return attrtext, value
2385
+
2386
+ def get_attribute(value):
2387
+ """ [CFWS] 1*attrtext [CFWS]
2388
+
2389
+ This version of the BNF makes the CFWS explicit, and as usual we use a
2390
+ value terminal for the actual run of characters. The RFC equivalent of
2391
+ attrtext is the token characters, with the subtraction of '*', "'", and '%'.
2392
+ We include tab in the excluded set just as we do for token.
2393
+
2394
+ """
2395
+ attribute = Attribute()
2396
+ if value and value[0] in CFWS_LEADER:
2397
+ token, value = get_cfws(value)
2398
+ attribute.append(token)
2399
+ if value and value[0] in ATTRIBUTE_ENDS:
2400
+ raise errors.HeaderParseError(
2401
+ "expected token but found '{}'".format(value))
2402
+ token, value = get_attrtext(value)
2403
+ attribute.append(token)
2404
+ if value and value[0] in CFWS_LEADER:
2405
+ token, value = get_cfws(value)
2406
+ attribute.append(token)
2407
+ return attribute, value
2408
+
2409
+ def get_extended_attrtext(value):
2410
+ """attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%')
2411
+
2412
+ This is a special parsing routine so that we get a value that
2413
+ includes % escapes as a single string (which we decode as a single
2414
+ string later).
2415
+
2416
+ """
2417
+ m = _non_extended_attribute_end_matcher(value)
2418
+ if not m:
2419
+ raise errors.HeaderParseError(
2420
+ "expected extended attrtext but found {!r}".format(value))
2421
+ attrtext = m.group()
2422
+ value = value[len(attrtext):]
2423
+ attrtext = ValueTerminal(attrtext, 'extended-attrtext')
2424
+ _validate_xtext(attrtext)
2425
+ return attrtext, value
2426
+
2427
+ def get_extended_attribute(value):
2428
+ """ [CFWS] 1*extended_attrtext [CFWS]
2429
+
2430
+ This is like the non-extended version except we allow % characters, so that
2431
+ we can pick up an encoded value as a single string.
2432
+
2433
+ """
2434
+ # XXX: should we have an ExtendedAttribute TokenList?
2435
+ attribute = Attribute()
2436
+ if value and value[0] in CFWS_LEADER:
2437
+ token, value = get_cfws(value)
2438
+ attribute.append(token)
2439
+ if value and value[0] in EXTENDED_ATTRIBUTE_ENDS:
2440
+ raise errors.HeaderParseError(
2441
+ "expected token but found '{}'".format(value))
2442
+ token, value = get_extended_attrtext(value)
2443
+ attribute.append(token)
2444
+ if value and value[0] in CFWS_LEADER:
2445
+ token, value = get_cfws(value)
2446
+ attribute.append(token)
2447
+ return attribute, value
2448
+
2449
+ def get_section(value):
2450
+ """ '*' digits
2451
+
2452
+ The formal BNF is more complicated because leading 0s are not allowed. We
2453
+ check for that and add a defect. We also assume no CFWS is allowed between
2454
+ the '*' and the digits, though the RFC is not crystal clear on that.
2455
+ The caller should already have dealt with leading CFWS.
2456
+
2457
+ """
2458
+ section = Section()
2459
+ if not value or value[0] != '*':
2460
+ raise errors.HeaderParseError("Expected section but found {}".format(
2461
+ value))
2462
+ section.append(ValueTerminal('*', 'section-marker'))
2463
+ value = value[1:]
2464
+ if not value or not value[0].isdigit():
2465
+ raise errors.HeaderParseError("Expected section number but "
2466
+ "found {}".format(value))
2467
+ digits = ''
2468
+ while value and value[0].isdigit():
2469
+ digits += value[0]
2470
+ value = value[1:]
2471
+ if digits[0] == '0' and digits != '0':
2472
+ section.defects.append(errors.InvalidHeaderDefect(
2473
+ "section number has an invalid leading 0"))
2474
+ section.number = int(digits)
2475
+ section.append(ValueTerminal(digits, 'digits'))
2476
+ return section, value
2477
+
2478
+
2479
+ def get_value(value):
2480
+ """ quoted-string / attribute
2481
+
2482
+ """
2483
+ v = Value()
2484
+ if not value:
2485
+ raise errors.HeaderParseError("Expected value but found end of string")
2486
+ leader = None
2487
+ if value[0] in CFWS_LEADER:
2488
+ leader, value = get_cfws(value)
2489
+ if not value:
2490
+ raise errors.HeaderParseError("Expected value but found "
2491
+ "only {}".format(leader))
2492
+ if value[0] == '"':
2493
+ token, value = get_quoted_string(value)
2494
+ else:
2495
+ token, value = get_extended_attribute(value)
2496
+ if leader is not None:
2497
+ token[:0] = [leader]
2498
+ v.append(token)
2499
+ return v, value
2500
+
2501
+ def get_parameter(value):
2502
+ """ attribute [section] ["*"] [CFWS] "=" value
2503
+
2504
+ The CFWS is implied by the RFC but not made explicit in the BNF. This
2505
+ simplified form of the BNF from the RFC is made to conform with the RFC BNF
2506
+ through some extra checks. We do it this way because it makes both error
2507
+ recovery and working with the resulting parse tree easier.
2508
+ """
2509
+ # It is possible CFWS would also be implicitly allowed between the section
2510
+ # and the 'extended-attribute' marker (the '*') , but we've never seen that
2511
+ # in the wild and we will therefore ignore the possibility.
2512
+ param = Parameter()
2513
+ token, value = get_attribute(value)
2514
+ param.append(token)
2515
+ if not value or value[0] == ';':
2516
+ param.defects.append(errors.InvalidHeaderDefect("Parameter contains "
2517
+ "name ({}) but no value".format(token)))
2518
+ return param, value
2519
+ if value[0] == '*':
2520
+ try:
2521
+ token, value = get_section(value)
2522
+ param.sectioned = True
2523
+ param.append(token)
2524
+ except errors.HeaderParseError:
2525
+ pass
2526
+ if not value:
2527
+ raise errors.HeaderParseError("Incomplete parameter")
2528
+ if value[0] == '*':
2529
+ param.append(ValueTerminal('*', 'extended-parameter-marker'))
2530
+ value = value[1:]
2531
+ param.extended = True
2532
+ if value[0] != '=':
2533
+ raise errors.HeaderParseError("Parameter not followed by '='")
2534
+ param.append(ValueTerminal('=', 'parameter-separator'))
2535
+ value = value[1:]
2536
+ if value and value[0] in CFWS_LEADER:
2537
+ token, value = get_cfws(value)
2538
+ param.append(token)
2539
+ remainder = None
2540
+ appendto = param
2541
+ if param.extended and value and value[0] == '"':
2542
+ # Now for some serious hackery to handle the common invalid case of
2543
+ # double quotes around an extended value. We also accept (with defect)
2544
+ # a value marked as encoded that isn't really.
2545
+ qstring, remainder = get_quoted_string(value)
2546
+ inner_value = qstring.stripped_value
2547
+ semi_valid = False
2548
+ if param.section_number == 0:
2549
+ if inner_value and inner_value[0] == "'":
2550
+ semi_valid = True
2551
+ else:
2552
+ token, rest = get_attrtext(inner_value)
2553
+ if rest and rest[0] == "'":
2554
+ semi_valid = True
2555
+ else:
2556
+ try:
2557
+ token, rest = get_extended_attrtext(inner_value)
2558
+ except:
2559
+ pass
2560
+ else:
2561
+ if not rest:
2562
+ semi_valid = True
2563
+ if semi_valid:
2564
+ param.defects.append(errors.InvalidHeaderDefect(
2565
+ "Quoted string value for extended parameter is invalid"))
2566
+ param.append(qstring)
2567
+ for t in qstring:
2568
+ if t.token_type == 'bare-quoted-string':
2569
+ t[:] = []
2570
+ appendto = t
2571
+ break
2572
+ value = inner_value
2573
+ else:
2574
+ remainder = None
2575
+ param.defects.append(errors.InvalidHeaderDefect(
2576
+ "Parameter marked as extended but appears to have a "
2577
+ "quoted string value that is non-encoded"))
2578
+ if value and value[0] == "'":
2579
+ token = None
2580
+ else:
2581
+ token, value = get_value(value)
2582
+ if not param.extended or param.section_number > 0:
2583
+ if not value or value[0] != "'":
2584
+ appendto.append(token)
2585
+ if remainder is not None:
2586
+ assert not value, value
2587
+ value = remainder
2588
+ return param, value
2589
+ param.defects.append(errors.InvalidHeaderDefect(
2590
+ "Apparent initial-extended-value but attribute "
2591
+ "was not marked as extended or was not initial section"))
2592
+ if not value:
2593
+ # Assume the charset/lang is missing and the token is the value.
2594
+ param.defects.append(errors.InvalidHeaderDefect(
2595
+ "Missing required charset/lang delimiters"))
2596
+ appendto.append(token)
2597
+ if remainder is None:
2598
+ return param, value
2599
+ else:
2600
+ if token is not None:
2601
+ for t in token:
2602
+ if t.token_type == 'extended-attrtext':
2603
+ break
2604
+ t.token_type == 'attrtext'
2605
+ appendto.append(t)
2606
+ param.charset = t.value
2607
+ if value[0] != "'":
2608
+ raise errors.HeaderParseError("Expected RFC2231 char/lang encoding "
2609
+ "delimiter, but found {!r}".format(value))
2610
+ appendto.append(ValueTerminal("'", 'RFC2231-delimiter'))
2611
+ value = value[1:]
2612
+ if value and value[0] != "'":
2613
+ token, value = get_attrtext(value)
2614
+ appendto.append(token)
2615
+ param.lang = token.value
2616
+ if not value or value[0] != "'":
2617
+ raise errors.HeaderParseError("Expected RFC2231 char/lang encoding "
2618
+ "delimiter, but found {}".format(value))
2619
+ appendto.append(ValueTerminal("'", 'RFC2231-delimiter'))
2620
+ value = value[1:]
2621
+ if remainder is not None:
2622
+ # Treat the rest of value as bare quoted string content.
2623
+ v = Value()
2624
+ while value:
2625
+ if value[0] in WSP:
2626
+ token, value = get_fws(value)
2627
+ elif value[0] == '"':
2628
+ token = ValueTerminal('"', 'DQUOTE')
2629
+ value = value[1:]
2630
+ else:
2631
+ token, value = get_qcontent(value)
2632
+ v.append(token)
2633
+ token = v
2634
+ else:
2635
+ token, value = get_value(value)
2636
+ appendto.append(token)
2637
+ if remainder is not None:
2638
+ assert not value, value
2639
+ value = remainder
2640
+ return param, value
2641
+
2642
+ def parse_mime_parameters(value):
2643
+ """ parameter *( ";" parameter )
2644
+
2645
+ That BNF is meant to indicate this routine should only be called after
2646
+ finding and handling the leading ';'. There is no corresponding rule in
2647
+ the formal RFC grammar, but it is more convenient for us for the set of
2648
+ parameters to be treated as its own TokenList.
2649
+
2650
+ This is 'parse' routine because it consumes the remaining value, but it
2651
+ would never be called to parse a full header. Instead it is called to
2652
+ parse everything after the non-parameter value of a specific MIME header.
2653
+
2654
+ """
2655
+ mime_parameters = MimeParameters()
2656
+ while value:
2657
+ try:
2658
+ token, value = get_parameter(value)
2659
+ mime_parameters.append(token)
2660
+ except errors.HeaderParseError:
2661
+ leader = None
2662
+ if value[0] in CFWS_LEADER:
2663
+ leader, value = get_cfws(value)
2664
+ if not value:
2665
+ mime_parameters.append(leader)
2666
+ return mime_parameters
2667
+ if value[0] == ';':
2668
+ if leader is not None:
2669
+ mime_parameters.append(leader)
2670
+ mime_parameters.defects.append(errors.InvalidHeaderDefect(
2671
+ "parameter entry with no content"))
2672
+ else:
2673
+ token, value = get_invalid_parameter(value)
2674
+ if leader:
2675
+ token[:0] = [leader]
2676
+ mime_parameters.append(token)
2677
+ mime_parameters.defects.append(errors.InvalidHeaderDefect(
2678
+ "invalid parameter {!r}".format(token)))
2679
+ if value and value[0] != ';':
2680
+ # Junk after the otherwise valid parameter. Mark it as
2681
+ # invalid, but it will have a value.
2682
+ param = mime_parameters[-1]
2683
+ param.token_type = 'invalid-parameter'
2684
+ token, value = get_invalid_parameter(value)
2685
+ param.extend(token)
2686
+ mime_parameters.defects.append(errors.InvalidHeaderDefect(
2687
+ "parameter with invalid trailing text {!r}".format(token)))
2688
+ if value:
2689
+ # Must be a ';' at this point.
2690
+ mime_parameters.append(ValueTerminal(';', 'parameter-separator'))
2691
+ value = value[1:]
2692
+ return mime_parameters
2693
+
2694
+ def _find_mime_parameters(tokenlist, value):
2695
+ """Do our best to find the parameters in an invalid MIME header
2696
+
2697
+ """
2698
+ while value and value[0] != ';':
2699
+ if value[0] in PHRASE_ENDS:
2700
+ tokenlist.append(ValueTerminal(value[0], 'misplaced-special'))
2701
+ value = value[1:]
2702
+ else:
2703
+ token, value = get_phrase(value)
2704
+ tokenlist.append(token)
2705
+ if not value:
2706
+ return
2707
+ tokenlist.append(ValueTerminal(';', 'parameter-separator'))
2708
+ tokenlist.append(parse_mime_parameters(value[1:]))
2709
+
2710
+ def parse_content_type_header(value):
2711
+ """ maintype "/" subtype *( ";" parameter )
2712
+
2713
+ The maintype and substype are tokens. Theoretically they could
2714
+ be checked against the official IANA list + x-token, but we
2715
+ don't do that.
2716
+ """
2717
+ ctype = ContentType()
2718
+ if not value:
2719
+ ctype.defects.append(errors.HeaderMissingRequiredValue(
2720
+ "Missing content type specification"))
2721
+ return ctype
2722
+ try:
2723
+ token, value = get_token(value)
2724
+ except errors.HeaderParseError:
2725
+ ctype.defects.append(errors.InvalidHeaderDefect(
2726
+ "Expected content maintype but found {!r}".format(value)))
2727
+ _find_mime_parameters(ctype, value)
2728
+ return ctype
2729
+ ctype.append(token)
2730
+ # XXX: If we really want to follow the formal grammar we should make
2731
+ # mantype and subtype specialized TokenLists here. Probably not worth it.
2732
+ if not value or value[0] != '/':
2733
+ ctype.defects.append(errors.InvalidHeaderDefect(
2734
+ "Invalid content type"))
2735
+ if value:
2736
+ _find_mime_parameters(ctype, value)
2737
+ return ctype
2738
+ ctype.maintype = token.value.strip().lower()
2739
+ ctype.append(ValueTerminal('/', 'content-type-separator'))
2740
+ value = value[1:]
2741
+ try:
2742
+ token, value = get_token(value)
2743
+ except errors.HeaderParseError:
2744
+ ctype.defects.append(errors.InvalidHeaderDefect(
2745
+ "Expected content subtype but found {!r}".format(value)))
2746
+ _find_mime_parameters(ctype, value)
2747
+ return ctype
2748
+ ctype.append(token)
2749
+ ctype.subtype = token.value.strip().lower()
2750
+ if not value:
2751
+ return ctype
2752
+ if value[0] != ';':
2753
+ ctype.defects.append(errors.InvalidHeaderDefect(
2754
+ "Only parameters are valid after content type, but "
2755
+ "found {!r}".format(value)))
2756
+ # The RFC requires that a syntactically invalid content-type be treated
2757
+ # as text/plain. Perhaps we should postel this, but we should probably
2758
+ # only do that if we were checking the subtype value against IANA.
2759
+ del ctype.maintype, ctype.subtype
2760
+ _find_mime_parameters(ctype, value)
2761
+ return ctype
2762
+ ctype.append(ValueTerminal(';', 'parameter-separator'))
2763
+ ctype.append(parse_mime_parameters(value[1:]))
2764
+ return ctype
2765
+
2766
+ def parse_content_disposition_header(value):
2767
+ """ disposition-type *( ";" parameter )
2768
+
2769
+ """
2770
+ disp_header = ContentDisposition()
2771
+ if not value:
2772
+ disp_header.defects.append(errors.HeaderMissingRequiredValue(
2773
+ "Missing content disposition"))
2774
+ return disp_header
2775
+ try:
2776
+ token, value = get_token(value)
2777
+ except errors.HeaderParseError:
2778
+ disp_header.defects.append(errors.InvalidHeaderDefect(
2779
+ "Expected content disposition but found {!r}".format(value)))
2780
+ _find_mime_parameters(disp_header, value)
2781
+ return disp_header
2782
+ disp_header.append(token)
2783
+ disp_header.content_disposition = token.value.strip().lower()
2784
+ if not value:
2785
+ return disp_header
2786
+ if value[0] != ';':
2787
+ disp_header.defects.append(errors.InvalidHeaderDefect(
2788
+ "Only parameters are valid after content disposition, but "
2789
+ "found {!r}".format(value)))
2790
+ _find_mime_parameters(disp_header, value)
2791
+ return disp_header
2792
+ disp_header.append(ValueTerminal(';', 'parameter-separator'))
2793
+ disp_header.append(parse_mime_parameters(value[1:]))
2794
+ return disp_header
2795
+
2796
+ def parse_content_transfer_encoding_header(value):
2797
+ """ mechanism
2798
+
2799
+ """
2800
+ # We should probably validate the values, since the list is fixed.
2801
+ cte_header = ContentTransferEncoding()
2802
+ if not value:
2803
+ cte_header.defects.append(errors.HeaderMissingRequiredValue(
2804
+ "Missing content transfer encoding"))
2805
+ return cte_header
2806
+ try:
2807
+ token, value = get_token(value)
2808
+ except errors.HeaderParseError:
2809
+ cte_header.defects.append(errors.InvalidHeaderDefect(
2810
+ "Expected content transfer encoding but found {!r}".format(value)))
2811
+ else:
2812
+ cte_header.append(token)
2813
+ cte_header.cte = token.value.strip().lower()
2814
+ if not value:
2815
+ return cte_header
2816
+ while value:
2817
+ cte_header.defects.append(errors.InvalidHeaderDefect(
2818
+ "Extra text after content transfer encoding"))
2819
+ if value[0] in PHRASE_ENDS:
2820
+ cte_header.append(ValueTerminal(value[0], 'misplaced-special'))
2821
+ value = value[1:]
2822
+ else:
2823
+ token, value = get_phrase(value)
2824
+ cte_header.append(token)
2825
+ return cte_header
2826
+
2827
+
2828
+ #
2829
+ # Header folding
2830
+ #
2831
+ # Header folding is complex, with lots of rules and corner cases. The
2832
+ # following code does its best to obey the rules and handle the corner
2833
+ # cases, but you can be sure there are few bugs:)
2834
+ #
2835
+ # This folder generally canonicalizes as it goes, preferring the stringified
2836
+ # version of each token. The tokens contain information that supports the
2837
+ # folder, including which tokens can be encoded in which ways.
2838
+ #
2839
+ # Folded text is accumulated in a simple list of strings ('lines'), each
2840
+ # one of which should be less than policy.max_line_length ('maxlen').
2841
+ #
2842
+
2843
+ def _steal_trailing_WSP_if_exists(lines):
2844
+ wsp = ''
2845
+ if lines and lines[-1] and lines[-1][-1] in WSP:
2846
+ wsp = lines[-1][-1]
2847
+ lines[-1] = lines[-1][:-1]
2848
+ # gh-142006: if the line is now empty, remove it entirely.
2849
+ if not lines[-1]:
2850
+ lines.pop()
2851
+ return wsp
2852
+
2853
+
2854
+ def _refold_parse_tree(parse_tree, *, policy):
2855
+ """Return string of contents of parse_tree folded according to RFC rules.
2856
+
2857
+ """
2858
+ # max_line_length 0/None means no limit, ie: infinitely long.
2859
+ maxlen = policy.max_line_length or sys.maxsize
2860
+ encoding = 'utf-8' if policy.utf8 else 'us-ascii'
2861
+ lines = [''] # Folded lines to be output
2862
+ last_word_is_ew = False
2863
+ last_ew = None # if there is an encoded word in the last line of lines,
2864
+ # points to the encoded word's first character
2865
+ last_charset = None
2866
+ wrap_as_ew_blocked = 0
2867
+ want_encoding = False # This is set to True if we need to encode this part
2868
+ end_ew_not_allowed = Terminal('', 'wrap_as_ew_blocked')
2869
+ parts = list(parse_tree)
2870
+ while parts:
2871
+ part = parts.pop(0)
2872
+ if part is end_ew_not_allowed:
2873
+ wrap_as_ew_blocked -= 1
2874
+ continue
2875
+ tstr = str(part)
2876
+ if not want_encoding:
2877
+ if part.token_type == 'ptext' or part.contains_token_type('vtext'):
2878
+ # Encode if tstr contains special characters.
2879
+ want_encoding = not SPECIALSNL.isdisjoint(tstr)
2880
+ else:
2881
+ # Encode if tstr contains newlines.
2882
+ want_encoding = not NLSET.isdisjoint(tstr)
2883
+ try:
2884
+ tstr.encode(encoding)
2885
+ charset = encoding
2886
+ except UnicodeEncodeError:
2887
+ if any(isinstance(x, errors.UndecodableBytesDefect)
2888
+ for x in part.all_defects):
2889
+ charset = 'unknown-8bit'
2890
+ else:
2891
+ # If policy.utf8 is false this should really be taken from a
2892
+ # 'charset' property on the policy.
2893
+ charset = 'utf-8'
2894
+ want_encoding = True
2895
+
2896
+ if part.token_type == 'mime-parameters':
2897
+ # Mime parameter folding (using RFC2231) is extra special.
2898
+ _fold_mime_parameters(part, lines, maxlen, encoding)
2899
+ last_word_is_ew = False
2900
+ continue
2901
+
2902
+ if want_encoding and not wrap_as_ew_blocked:
2903
+ if not part.as_ew_allowed:
2904
+ want_encoding = False
2905
+ last_ew = None
2906
+ if part.syntactic_break:
2907
+ encoded_part = part.fold(policy=policy)[:-len(policy.linesep)]
2908
+ if policy.linesep not in encoded_part:
2909
+ # It fits on a single line
2910
+ if len(encoded_part) > maxlen - len(lines[-1]):
2911
+ # But not on this one, so start a new one.
2912
+ newline = _steal_trailing_WSP_if_exists(lines)
2913
+ # XXX what if encoded_part has no leading FWS?
2914
+ lines.append(newline)
2915
+ lines[-1] += encoded_part
2916
+ last_word_is_ew = False
2917
+ continue
2918
+ # Either this is not a major syntactic break, so we don't
2919
+ # want it on a line by itself even if it fits, or it
2920
+ # doesn't fit on a line by itself. Either way, fall through
2921
+ # to unpacking the subparts and wrapping them.
2922
+ if not hasattr(part, 'encode'):
2923
+ # It's not a Terminal, do each piece individually.
2924
+ parts = list(part) + parts
2925
+ want_encoding = False
2926
+ continue
2927
+ elif part.as_ew_allowed:
2928
+ # It's a terminal, wrap it as an encoded word, possibly
2929
+ # combining it with previously encoded words if allowed.
2930
+ if (last_ew is not None and
2931
+ charset != last_charset and
2932
+ (last_charset == 'unknown-8bit' or
2933
+ last_charset == 'utf-8' and charset != 'us-ascii')):
2934
+ last_ew = None
2935
+ last_ew = _fold_as_ew(
2936
+ tstr,
2937
+ lines,
2938
+ maxlen,
2939
+ last_ew,
2940
+ part.ew_combine_allowed,
2941
+ charset,
2942
+ last_word_is_ew,
2943
+ )
2944
+ last_word_is_ew = True
2945
+ last_charset = charset
2946
+ want_encoding = False
2947
+ continue
2948
+ else:
2949
+ # It's a terminal which should be kept non-encoded
2950
+ # (e.g. a ListSeparator).
2951
+ last_ew = None
2952
+ want_encoding = False
2953
+ # fall through
2954
+
2955
+ if len(tstr) <= maxlen - len(lines[-1]):
2956
+ lines[-1] += tstr
2957
+ last_word_is_ew = last_word_is_ew and not bool(tstr.strip(_WSP))
2958
+ continue
2959
+
2960
+ # This part is too long to fit. The RFC wants us to break at
2961
+ # "major syntactic breaks", so unless we don't consider this
2962
+ # to be one, check if it will fit on the next line by itself.
2963
+ if (part.syntactic_break and
2964
+ len(tstr) + 1 <= maxlen):
2965
+ newline = _steal_trailing_WSP_if_exists(lines)
2966
+ if newline or part.startswith_fws():
2967
+ lines.append(newline + tstr)
2968
+ last_word_is_ew = (last_word_is_ew
2969
+ and not bool(lines[-1].strip(_WSP)))
2970
+ last_ew = None
2971
+ continue
2972
+ if not hasattr(part, 'encode'):
2973
+ # It's not a terminal, try folding the subparts.
2974
+ newparts = list(part)
2975
+ if part.token_type == 'bare-quoted-string':
2976
+ # To fold a quoted string we need to create a list of terminal
2977
+ # tokens that will render the leading and trailing quotes
2978
+ # and use quoted pairs in the value as appropriate.
2979
+ newparts = (
2980
+ [ValueTerminal('"', 'ptext')] +
2981
+ [ValueTerminal(make_quoted_pairs(p), 'ptext')
2982
+ for p in newparts] +
2983
+ [ValueTerminal('"', 'ptext')])
2984
+ if part.token_type == 'comment':
2985
+ newparts = (
2986
+ [ValueTerminal('(', 'ptext')] +
2987
+ [ValueTerminal(make_parenthesis_pairs(p), 'ptext')
2988
+ if p.token_type == 'ptext' else p
2989
+ for p in newparts] +
2990
+ [ValueTerminal(')', 'ptext')])
2991
+ if not part.as_ew_allowed:
2992
+ wrap_as_ew_blocked += 1
2993
+ newparts.append(end_ew_not_allowed)
2994
+ parts = newparts + parts
2995
+ continue
2996
+ if part.as_ew_allowed and not wrap_as_ew_blocked:
2997
+ # It doesn't need CTE encoding, but encode it anyway so we can
2998
+ # wrap it.
2999
+ parts.insert(0, part)
3000
+ want_encoding = True
3001
+ continue
3002
+ # We can't figure out how to wrap, it, so give up.
3003
+ newline = _steal_trailing_WSP_if_exists(lines)
3004
+ if newline or part.startswith_fws():
3005
+ lines.append(newline + tstr)
3006
+ else:
3007
+ # We can't fold it onto the next line either...
3008
+ lines[-1] += tstr
3009
+ last_word_is_ew = last_word_is_ew and not bool(tstr.strip(_WSP))
3010
+
3011
+ return policy.linesep.join(lines) + policy.linesep
3012
+
3013
+ def _fold_as_ew(to_encode, lines, maxlen, last_ew, ew_combine_allowed, charset, last_word_is_ew):
3014
+ """Fold string to_encode into lines as encoded word, combining if allowed.
3015
+ Return the new value for last_ew, or None if ew_combine_allowed is False.
3016
+
3017
+ If there is already an encoded word in the last line of lines (indicated by
3018
+ a non-None value for last_ew) and ew_combine_allowed is true, decode the
3019
+ existing ew, combine it with to_encode, and re-encode. Otherwise, encode
3020
+ to_encode. In either case, split to_encode as necessary so that the
3021
+ encoded segments fit within maxlen.
3022
+
3023
+ """
3024
+ if last_ew is not None and ew_combine_allowed:
3025
+ to_encode = str(
3026
+ get_unstructured(lines[-1][last_ew:] + to_encode))
3027
+ lines[-1] = lines[-1][:last_ew]
3028
+ elif last_word_is_ew:
3029
+ # If we are following up an encoded word with another encoded word,
3030
+ # any white space between the two will be ignored when decoded.
3031
+ # Therefore, we encode all to-be-displayed whitespace in the second
3032
+ # encoded word.
3033
+ len_without_wsp = len(lines[-1].rstrip(_WSP))
3034
+ leading_whitespace = lines[-1][len_without_wsp:]
3035
+ lines[-1] = (lines[-1][:len_without_wsp]
3036
+ + (' ' if leading_whitespace else ''))
3037
+ to_encode = leading_whitespace + to_encode
3038
+ elif to_encode[0] in WSP:
3039
+ # We're joining this to non-encoded text, so don't encode
3040
+ # the leading blank.
3041
+ leading_wsp = to_encode[0]
3042
+ to_encode = to_encode[1:]
3043
+ if (len(lines[-1]) == maxlen):
3044
+ lines.append(_steal_trailing_WSP_if_exists(lines))
3045
+ lines[-1] += leading_wsp
3046
+
3047
+ trailing_wsp = ''
3048
+ if to_encode[-1] in WSP:
3049
+ # Likewise for the trailing space.
3050
+ trailing_wsp = to_encode[-1]
3051
+ to_encode = to_encode[:-1]
3052
+ new_last_ew = len(lines[-1]) if last_ew is None else last_ew
3053
+
3054
+ encode_as = 'utf-8' if charset == 'us-ascii' else charset
3055
+
3056
+ # The RFC2047 chrome takes up 7 characters plus the length
3057
+ # of the charset name.
3058
+ chrome_len = len(encode_as) + 7
3059
+
3060
+ if (chrome_len + 1) >= maxlen:
3061
+ raise errors.HeaderParseError(
3062
+ "max_line_length is too small to fit an encoded word")
3063
+
3064
+ while to_encode:
3065
+ remaining_space = maxlen - len(lines[-1])
3066
+ text_space = remaining_space - chrome_len
3067
+ if text_space <= 0:
3068
+ newline = _steal_trailing_WSP_if_exists(lines)
3069
+ lines.append(newline or ' ')
3070
+ new_last_ew = len(lines[-1])
3071
+ continue
3072
+
3073
+ to_encode_word = to_encode[:text_space]
3074
+ encoded_word = _ew.encode(to_encode_word, charset=encode_as)
3075
+ excess = len(encoded_word) - remaining_space
3076
+ while excess > 0:
3077
+ # Since the chunk to encode is guaranteed to fit into less than 100 characters,
3078
+ # shrinking it by one at a time shouldn't take long.
3079
+ to_encode_word = to_encode_word[:-1]
3080
+ encoded_word = _ew.encode(to_encode_word, charset=encode_as)
3081
+ excess = len(encoded_word) - remaining_space
3082
+ lines[-1] += encoded_word
3083
+ to_encode = to_encode[len(to_encode_word):]
3084
+
3085
+ if to_encode:
3086
+ lines.append(' ')
3087
+ new_last_ew = len(lines[-1])
3088
+ lines[-1] += trailing_wsp
3089
+ return new_last_ew if ew_combine_allowed else None
3090
+
3091
+ def _fold_mime_parameters(part, lines, maxlen, encoding):
3092
+ """Fold TokenList 'part' into the 'lines' list as mime parameters.
3093
+
3094
+ Using the decoded list of parameters and values, format them according to
3095
+ the RFC rules, including using RFC2231 encoding if the value cannot be
3096
+ expressed in 'encoding' and/or the parameter+value is too long to fit
3097
+ within 'maxlen'.
3098
+
3099
+ """
3100
+ # Special case for RFC2231 encoding: start from decoded values and use
3101
+ # RFC2231 encoding iff needed.
3102
+ #
3103
+ # Note that the 1 and 2s being added to the length calculations are
3104
+ # accounting for the possibly-needed spaces and semicolons we'll be adding.
3105
+ #
3106
+ for name, value in part.params:
3107
+ # XXX What if this ';' puts us over maxlen the first time through the
3108
+ # loop? We should split the header value onto a newline in that case,
3109
+ # but to do that we need to recognize the need earlier or reparse the
3110
+ # header, so I'm going to ignore that bug for now. It'll only put us
3111
+ # one character over.
3112
+ if not lines[-1].rstrip().endswith(';'):
3113
+ lines[-1] += ';'
3114
+ charset = encoding
3115
+ error_handler = 'strict'
3116
+ try:
3117
+ value.encode(encoding)
3118
+ encoding_required = False
3119
+ except UnicodeEncodeError:
3120
+ encoding_required = True
3121
+ if utils._has_surrogates(value):
3122
+ charset = 'unknown-8bit'
3123
+ error_handler = 'surrogateescape'
3124
+ else:
3125
+ charset = 'utf-8'
3126
+ if encoding_required:
3127
+ encoded_value = urllib.parse.quote(
3128
+ value, safe='', errors=error_handler)
3129
+ tstr = "{}*={}''{}".format(name, charset, encoded_value)
3130
+ else:
3131
+ tstr = '{}={}'.format(name, quote_string(value))
3132
+ if len(lines[-1]) + len(tstr) + 1 < maxlen:
3133
+ lines[-1] = lines[-1] + ' ' + tstr
3134
+ continue
3135
+ elif len(tstr) + 2 <= maxlen:
3136
+ lines.append(' ' + tstr)
3137
+ continue
3138
+ # We need multiple sections. We are allowed to mix encoded and
3139
+ # non-encoded sections, but we aren't going to. We'll encode them all.
3140
+ section = 0
3141
+ extra_chrome = charset + "''"
3142
+ while value:
3143
+ chrome_len = len(name) + len(str(section)) + 3 + len(extra_chrome)
3144
+ if maxlen <= chrome_len + 3:
3145
+ # We need room for the leading blank, the trailing semicolon,
3146
+ # and at least one character of the value. If we don't
3147
+ # have that, we'd be stuck, so in that case fall back to
3148
+ # the RFC standard width.
3149
+ maxlen = 78
3150
+ splitpoint = maxchars = maxlen - chrome_len - 2
3151
+ while True:
3152
+ partial = value[:splitpoint]
3153
+ encoded_value = urllib.parse.quote(
3154
+ partial, safe='', errors=error_handler)
3155
+ if len(encoded_value) <= maxchars:
3156
+ break
3157
+ splitpoint -= 1
3158
+ lines.append(" {}*{}*={}{}".format(
3159
+ name, section, extra_chrome, encoded_value))
3160
+ extra_chrome = ''
3161
+ section += 1
3162
+ value = value[splitpoint:]
3163
+ if value:
3164
+ lines[-1] += ';'