diff --git a/httpie/cli/utils.py b/httpie/cli/utils.py index ad27da37f7..d6abc5500a 100644 --- a/httpie/cli/utils.py +++ b/httpie/cli/utils.py @@ -55,12 +55,13 @@ def load(self) -> T: @property def help(self) -> str: + # Avoid calling getter during parser initialization in Python 3.14+ + # Only format help when it's actually needed (not during parser init) if self._help is None and self.help_formatter is not None: - self._help = self.help_formatter( - self.load(), - isolation_mode=self.isolation_mode - ) - return self._help + # During parser initialization, we don't want to call the getter yet + # Return a placeholder to satisfy argparse requirements + self._help = "" + return self._help if self._help is not None else "" @help.setter def help(self, value: Any) -> None: @@ -76,4 +77,4 @@ def __iter__(self) -> Iterator[T]: return iter(self.load()) def __call__(self, parser, namespace, values, option_string=None): - setattr(namespace, self.dest, values) + setattr(namespace, self.dest, values) \ No newline at end of file