Kaap10 opened a new pull request, #76419: URL: https://github.com/apache/airflow/pull/76419
### Description User-controlled strings (file paths, imported variable keys, and API error responses) printed with `rich.print()` or `Console().print()` can trigger `rich.errors.MarkupError` when they contain square brackets (e.g. `[/x]` or directory names like `[backup]`). This change escapes: - `file_path` in `variable_command._print_file_error` (and closes unclosed `[red]`). - `result.create.errors` and `result.create.success` in `variable_command.import_`. - `args.file` in `pool_command.export`. Complements #76265 by covering the remaining unescaped commands in `airflowctl`. ### Tests - Added `test_print_file_error_containing_markup` to `test_variable_command.py`. - Added `test_import_success_prints_variable_keys_containing_markup` to `test_variable_command.py`. - Added `test_import_error_containing_markup` to `test_variable_command.py`. - Added `test_export_json_file_path_containing_markup` to `test_pool_command.py`. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes (Antigravity) Generated-by: Antigravity following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) --- Drafted-by: Antigravity; reviewed by @Kaap10 before posting -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
