Fix the cli_options.stdout pattern #4048

Open
opened 2023-07-20 18:18:23 +00:00 by exarkun · 1 comment
exarkun commented 2023-07-20 18:18:23 +00:00
Owner

In tor_provider and i2p_provider, https://github.com/tahoe-lafs/tahoe-lafs/pull/1283 introduced a couple type ignore comments to suppress the mypy error now present in those places due to new type annotations. The error complains about Options having no stdout attribute. It's true the type doesn't generally, but runner.py puts one there.

Instead of dynamically adding extra attributes to Options, the code should either pass stdout (and stderr I think?) separately or introduce a new type specifically for representing an options value and some more stuff.

In tor_provider and i2p_provider, <https://github.com/tahoe-lafs/tahoe-lafs/pull/1283> introduced a couple type ignore comments to suppress the mypy error now present in those places due to new type annotations. The error complains about `Options` having no `stdout` attribute. It's true the type doesn't generally, but `runner.py` puts one there. Instead of dynamically adding extra attributes to `Options`, the code should either pass stdout (and stderr I think?) separately or introduce a new type specifically for representing an options value and some more stuff.
tahoe-lafs added the
unknown
normal
defect
n/a
labels 2023-07-20 18:18:23 +00:00
tahoe-lafs added this to the undecided milestone 2023-07-20 18:18:23 +00:00
exarkun commented 2023-07-20 18:19:58 +00:00
Author
Owner

Also, this "add a stdout/stderr" pattern appears elsewhere - but in places mypy isn't checking yet.

Also, this "add a stdout/stderr" pattern appears elsewhere - but in places mypy isn't checking yet.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: tahoe-lafs/trac-2024-07-25#4048
No description provided.