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

pkgutil.get_data() is a wrapper for a deprecated class #79500

Open
KevinNorris mannequin opened this issue Nov 26, 2018 · 2 comments
Open

pkgutil.get_data() is a wrapper for a deprecated class #79500

KevinNorris mannequin opened this issue Nov 26, 2018 · 2 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@KevinNorris
Copy link
Mannequin

KevinNorris mannequin commented Nov 26, 2018

BPO 35319
Nosy @brettcannon

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 2018-11-26.19:15:58.253>
labels = ['3.7', '3.8', 'type-bug', 'library', 'docs']
title = 'pkgutil.get_data() is a wrapper for a deprecated class'
updated_at = <Date 2018-11-27.23:43:17.777>
user = 'https://bugs.python.org/KevinNorris'

bugs.python.org fields:

activity = <Date 2018-11-27.23:43:17.777>
actor = 'brett.cannon'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation', 'Library (Lib)']
creation = <Date 2018-11-26.19:15:58.253>
creator = 'Kevin.Norris'
dependencies = []
files = []
hgrepos = []
issue_num = 35319
keywords = []
message_count = 2.0
messages = ['330456', '330561']
nosy_count = 3.0
nosy_names = ['brett.cannon', 'docs@python', 'Kevin.Norris']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue35319'
versions = ['Python 3.7', 'Python 3.8']

@KevinNorris
Copy link
Mannequin Author

KevinNorris mannequin commented Nov 26, 2018

pkgutil.get_data()'s documentation1 says it is a wrapper for importlib.abc.ResourceLoader.get_data(), but the latter's documentation2 says the whole class is deprecated since 3.7.

Please either:

A. Formally deprecate pkgutil.get_data() (and ideally provide a "nice" alternative wrapper, so that I don't have to muck about with importlib's endless heterarchy of opaque objects which return other opaque objects).
B. Modify pkgutil.get_data() to use ResourceReader instead of ResourceLoader.
C. (A) or (B) has already been done, just document it.

@KevinNorris KevinNorris mannequin added 3.7 (EOL) end of life 3.8 only security fixes labels Nov 26, 2018
@KevinNorris KevinNorris mannequin assigned docspython Nov 26, 2018
@KevinNorris KevinNorris mannequin added docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Nov 26, 2018
@brettcannon
Copy link
Member

You can use importlib.resources to read data files and such from within a package as an alternative.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life 3.8 only security fixes docs Documentation in the Doc dir stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant