Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add errors argument to importlib.abc.Traversable.read_text #88368

Closed
FFY00 opened this issue May 21, 2021 · 5 comments
Closed

Add errors argument to importlib.abc.Traversable.read_text #88368

FFY00 opened this issue May 21, 2021 · 5 comments
Labels
3.11 only security fixes stdlib Python modules in the Lib dir topic-importlib

Comments

@FFY00
Copy link
Member

FFY00 commented May 21, 2021

BPO 44202
Nosy @brettcannon, @jaraco, @FFY00

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-05-21.00:40:18.784>
labels = ['library', '3.11']
title = 'Add errors argument to importlib.abc.Traversable.read_text'
updated_at = <Date 2021-05-23.17:42:07.295>
user = 'https://github.com/FFY00'

bugs.python.org fields:

activity = <Date 2021-05-23.17:42:07.295>
actor = 'jaraco'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-05-21.00:40:18.784>
creator = 'FFY00'
dependencies = []
files = []
hgrepos = []
issue_num = 44202
keywords = []
message_count = 3.0
messages = ['394088', '394089', '394212']
nosy_count = 3.0
nosy_names = ['brett.cannon', 'jaraco', 'FFY00']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue44202'
versions = ['Python 3.11']

@FFY00
Copy link
Member Author

FFY00 commented May 21, 2021

errors should be supported by Traversable.open and is currently supported in importlib.resources.open_text, but Traversable.read_text cannot do it, making it an unsuitable replacement for open_text.

@FFY00
Copy link
Member Author

FFY00 commented May 21, 2021

I am gonna wait until/if #70460 (bpo-44196) gets merged to submit a PR because it will conflict with that.

@FFY00 FFY00 added stdlib Python modules in the Lib dir 3.11 only security fixes labels May 21, 2021
@jaraco
Copy link
Member

jaraco commented May 23, 2021

It would be straightforward to add that parameter to read_text but I'm uncertain if it will be needed. Since a Traversable already provides an open method which does explicitly pass through keyword arguments to the underlying opener, perhaps it would be best to direct users to that interface if errors is needed and save supporting that parameter for read_text unless a user experience demands it. WDYT?

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@FFY00
Copy link
Member Author

FFY00 commented May 2, 2022

That sounds reasonable, though it makes it slightly harder for users of the legacy API to migrate. It shouldn't be a big deal though.

@jaraco
Copy link
Member

jaraco commented Nov 26, 2022

Sounds like we're comfortable closing this issue until there's a demand for the behavior.

@jaraco jaraco closed this as completed Nov 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes stdlib Python modules in the Lib dir topic-importlib
Projects
None yet
Development

No branches or pull requests

3 participants