man: Remove FileType argument types in parser standard options arguments #5561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was another ResourceWarning error in manual generation that I solved after #5560. The unclosed files were defined in the argparse arguments with FileType type.
The argparse FileType argument type will be deprecated in Python 3.14. It does not properly close files if a subsequent error in another FileType argument occurs when parsing. The suggestion is to use context managers after parsing the arguments. The implementation of the changes is inspired by a PR doing the same in the CPython repo.
Other small changes included in (wasn't worth a separate PR):
urlopen()'s proxies argument. It was for the old interface. Default proxy handling is used now. It allowed correct type checking.res.append(line) if res is not None else None, replaced withelif res is not None:andres.append(line), as intended 10+ years ago.optnamevariable in functionsplit_in_groupsif ever the first condition wasn't executed for a previous line (for type checking, as it was unbounded otherwise)htmlparmastohtmlparams(two occurrences only, used once)if line.startswith("/*"):continuethat was not required because of the condition above, that already checked for this situation just above.Type checking was added to touched/impacted functions to validate correct usages.