rasa-pro 3.11.19__py3-none-any.whl → 3.11.20__py3-none-any.whl

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

Potentially problematic release.


This version of rasa-pro might be problematic. Click here for more details.

@@ -1,15 +1,17 @@
1
1
  from __future__ import annotations
2
2
 
3
3
  import logging
4
+ import os
4
5
  import shutil
5
6
  import sys
7
+ import tarfile
6
8
  import tempfile
7
9
  import uuid
8
10
  from contextlib import contextmanager
9
11
  from datetime import datetime
10
12
  from pathlib import Path
11
13
  from tarsafe import TarSafe
12
- from typing import Generator, Optional, Text, Tuple, Union
14
+ from typing import Callable, Generator, Optional, Text, Tuple, Union
13
15
 
14
16
  import rasa.utils.common
15
17
  import rasa.shared.utils.io
@@ -56,6 +58,35 @@ def windows_safe_temporary_directory(
56
58
  yield temporary_directory
57
59
 
58
60
 
61
+ def filter_normpath(member: tarfile.TarInfo, dest_path: str) -> tarfile.TarInfo:
62
+ """Normalize tar member paths for safe extraction"""
63
+ if member.name:
64
+ member.name = os.path.normpath(member.name)
65
+ return member
66
+
67
+
68
+ FilterFunction = Callable[[tarfile.TarInfo, str], Optional[tarfile.TarInfo]]
69
+
70
+
71
+ def create_combined_filter(existing_filter: Optional[FilterFunction]) -> FilterFunction:
72
+ """Create a filter that combines existing filter with path normalization"""
73
+
74
+ def combined_filter(
75
+ member: tarfile.TarInfo, dest_path: str
76
+ ) -> Optional[tarfile.TarInfo]:
77
+ """Apply existing filter first, then path normalization"""
78
+ if existing_filter is not None:
79
+ filtered_member = existing_filter(member, dest_path)
80
+ if filtered_member is None:
81
+ return None # Rejected by existing filter
82
+ member = filtered_member # Use the filtered result
83
+
84
+ # Apply our path normalization
85
+ return filter_normpath(member, dest_path)
86
+
87
+ return combined_filter
88
+
89
+
59
90
  class LocalModelStorage(ModelStorage):
60
91
  """Stores and provides output of `GraphComponents` on local disk."""
61
92
 
@@ -121,7 +152,19 @@ class LocalModelStorage(ModelStorage):
121
152
  # this restriction in environments where it's not possible
122
153
  # to override this behavior, mostly for internal policy reasons
123
154
  # reference: https://stackoverflow.com/a/49102229
124
- tar.extractall(f"\\\\?\\{temporary_directory}")
155
+ try:
156
+ # Use extraction filter to normalize paths for compatibility
157
+ # before trying the \\?\ prefix approach first
158
+ prev_filter = getattr(tar, "extraction_filter", None)
159
+ tar.extraction_filter = create_combined_filter(prev_filter)
160
+ tar.extractall(f"\\\\?\\{temporary_directory}")
161
+ except Exception:
162
+ # Fallback for Python versions with tarfile security fix
163
+ logger.warning(
164
+ "Failed to extract model archive with long path support. "
165
+ "Falling back to regular extraction."
166
+ )
167
+ tar.extractall(temporary_directory)
125
168
  else:
126
169
  tar.extractall(temporary_directory)
127
170
  LocalModelStorage._assert_not_rasa2_archive(temporary_directory)
rasa/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  # this file will automatically be changed,
2
2
  # do not add anything but the version number here!
3
- __version__ = "3.11.19"
3
+ __version__ = "3.11.20"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: rasa-pro
3
- Version: 3.11.19
3
+ Version: 3.11.20
4
4
  Summary: State-of-the-art open-core Conversational AI framework for Enterprises that natively leverages generative AI for effortless assistant development.
5
5
  Keywords: nlp,machine-learning,machine-learning-library,bot,bots,botkit,rasa conversational-agents,conversational-ai,chatbot,chatbot-framework,bot-framework
6
6
  Author: Rasa Technologies GmbH
@@ -467,7 +467,7 @@ rasa/engine/runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuF
467
467
  rasa/engine/runner/dask.py,sha256=38_euDX21U0ccfOLMd-lPsKOlt5ctJJcQIVOG74LIH8,9476
468
468
  rasa/engine/runner/interface.py,sha256=4mbJSMbXPwnITDl5maYZjq8sUcbWw1ToGjYVQtnWCkc,1678
469
469
  rasa/engine/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
470
- rasa/engine/storage/local_model_storage.py,sha256=FrRFJJBC3Zy7w8YkMNtLHJUxbRp5foTz6jUQJUtQC-w,9531
470
+ rasa/engine/storage/local_model_storage.py,sha256=QkM8mWQ_KxshgAaU-kJIEamGDxw30c-lTS0pD5hT4pA,11306
471
471
  rasa/engine/storage/resource.py,sha256=1ecgZbDw7y6CLLFLdi5cYRfdk0yTmD7V1seWEzdtzpU,3931
472
472
  rasa/engine/storage/storage.py,sha256=kI2Me9X1-vCHTzsgnQDNSJJmnd1j7jB13aU1E3gXCXo,6739
473
473
  rasa/engine/training/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -782,9 +782,9 @@ rasa/utils/train_utils.py,sha256=f1NWpp5y6al0dzoQyyio4hc4Nf73DRoRSHDzEK6-C4E,212
782
782
  rasa/utils/url_tools.py,sha256=JQcHL2aLqLHu82k7_d9imUoETCm2bmlHaDpOJ-dKqBc,1218
783
783
  rasa/utils/yaml.py,sha256=KjbZq5C94ZP7Jdsw8bYYF7HASI6K4-C_kdHfrnPLpSI,2000
784
784
  rasa/validator.py,sha256=O1wjCeV7ITJ0luvb3GCWy8x1fGgzWVbClEMlPnLBowQ,67265
785
- rasa/version.py,sha256=pmdere9Uxlv-iH9Zkey9rE9fLvCleo8Dv113M6CzMy0,118
786
- rasa_pro-3.11.19.dist-info/METADATA,sha256=5NFTwELfaCiJSYY2jzOWNJK-_BGfmOp14Ire827htvw,10725
787
- rasa_pro-3.11.19.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
788
- rasa_pro-3.11.19.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
789
- rasa_pro-3.11.19.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
790
- rasa_pro-3.11.19.dist-info/RECORD,,
785
+ rasa/version.py,sha256=tYGv-HfaYq4etFK-PNE5n3tj7BlDYTMovozA-UGTvYA,118
786
+ rasa_pro-3.11.20.dist-info/METADATA,sha256=XDs8Fw72qGdOFX8ZGF3a7b6B9PzPWdHJ2mTmPJIPAHM,10725
787
+ rasa_pro-3.11.20.dist-info/NOTICE,sha256=7HlBoMHJY9CL2GlYSfTQ-PZsVmLmVkYmMiPlTjhuCqA,218
788
+ rasa_pro-3.11.20.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
789
+ rasa_pro-3.11.20.dist-info/entry_points.txt,sha256=ckJ2SfEyTPgBqj_I6vm_tqY9dZF_LAPJZA335Xp0Q9U,43
790
+ rasa_pro-3.11.20.dist-info/RECORD,,