uyivzola opened a new pull request, #77509: URL: https://github.com/apache/airflow/pull/77509
Switch to binary transfer mode before requesting a file's size. A fresh FTP session uses ASCII mode, and a directory listing can switch an existing session back to it. Servers such as pyftpdlib then reject `SIZE` with `550 SIZE not allowed in ASCII mode.` The existing parametrized test now checks that `TYPE I` precedes `SIZE`, while retaining coverage for ordinary files, empty files, and a missing size reply. The change also applies to the inherited `FTPSHook.get_size()` method. Validation: - All 73 FTP provider unit tests pass on Python 3.12.11. - The three size regression cases fail without the production change and pass with it. - A loopback pyftpdlib 2.2.0 server reproduces the failure before the change. Afterward, fresh-session and post-listing queries both return 23 bytes, an empty file returns 0, missing-file errors still propagate, and a binary download matches the original bytes. - Fast and manual `prek` checks pass, including the all-provider mypy check. - The core and dependent-provider test groups selected by `breeze verify` pass on Python 3.11.18. The non-database provider rerun completed with 7,845 passed and 161 skipped using `COLUMNS=200`; the existing Glue table-log assertion wraps differently at the default terminal width. - `breeze build-docs amazon common.compat ftp openlineage` passes. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Codex (GPT-6) Generated-by: Codex (GPT-6) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) --- Drafted-by: Codex (GPT-6) (no human review 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]
