Fix the cli_options.stdout pattern #4048

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

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.
exarkun added the
unknown
normal
defect
n/a
labels 2023-07-20 18:18:23 +00:00
exarkun added this to the undecided milestone 2023-07-20 18:18:23 +00:00
Author

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 Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

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