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

inspect missing warnings import #59192

Closed
pnasrat mannequin opened this issue Jun 2, 2012 · 2 comments
Closed

inspect missing warnings import #59192

pnasrat mannequin opened this issue Jun 2, 2012 · 2 comments
Assignees
Labels
stdlib Python modules in the Lib dir

Comments

@pnasrat
Copy link
Mannequin

pnasrat mannequin commented Jun 2, 2012

BPO 14987
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 = 'https://github.com/brettcannon'
closed_at = <Date 2012-06-03.02:29:14.080>
created_at = <Date 2012-06-02.22:00:06.655>
labels = ['library']
title = 'inspect missing warnings import'
updated_at = <Date 2012-06-03.02:29:14.080>
user = 'https://bugs.python.org/pnasrat'

bugs.python.org fields:

activity = <Date 2012-06-03.02:29:14.080>
actor = 'brett.cannon'
assignee = 'brett.cannon'
closed = True
closed_date = <Date 2012-06-03.02:29:14.080>
closer = 'brett.cannon'
components = ['Library (Lib)']
creation = <Date 2012-06-02.22:00:06.655>
creator = 'pnasrat'
dependencies = []
files = []
hgrepos = []
issue_num = 14987
keywords = []
message_count = 2.0
messages = ['162184', '162188']
nosy_count = 3.0
nosy_names = ['brett.cannon', 'pnasrat', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue14987'
versions = ['Python 3.3']

@pnasrat
Copy link
Mannequin Author

pnasrat mannequin commented Jun 2, 2012

Whilst looking for workarounds to http://bugs.python.org/issue14982 I came across this, which is due to inspect using warnings without having importing it.

Fix is trivial but can upload a patch

Traceback (most recent call last):
  File "t.py", line 7, in <module>
    print(list(iter_modules(path=vcs.__path__, prefix=vcs.__name__+'.')))
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/pkgutil.py", line 144, in iter_modules
    for name, ispkg in iter_importer_modules(i, prefix):
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/pkgutil.py", line 202, in iter_modules
    modname = inspect.getmodulename(fn)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/inspect.py", line 448, in getmodulename
    info = getmoduleinfo(path)
  File "/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/inspect.py", line 436, in getmoduleinfo
    warnings.warn('inspect.getmoduleinfo() is deprecated', DeprecationWarning,
NameError: global name 'warnings' is not defined

@pnasrat pnasrat mannequin added the stdlib Python modules in the Lib dir label Jun 2, 2012
@python-dev
Copy link
Mannequin

python-dev mannequin commented Jun 3, 2012

New changeset 3de5b053d924 by Brett Cannon in branch 'default':
Issue bpo-14987: Add a missing import statement
http://hg.python.org/cpython/rev/3de5b053d924

@brettcannon brettcannon self-assigned this Jun 3, 2012
@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
stdlib Python modules in the Lib dir
Projects
None yet
Development

No branches or pull requests

1 participant