This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Inspect module broken
Type: Stage:
Components: Versions: Python 3.3
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: beruic, zach.ware
Priority: normal Keywords:

Created on 2013-12-10 14:49 by beruic, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (4)
msg205818 - (view) Author: Jimmy Merrild Krag (beruic) Date: 2013-12-10 14:49
I have been having issues like the below all day:

C:\JMK\CurrentWork\CPH-3516>python airport_code_downloader.py
Traceback (most recent call last):
  File "airport_code_downloader.py", line 4, in <module>
    import inspect
  File "C:\Python33\lib\inspect.py", line 53, in <module>
    from dis import COMPILER_FLAG_NAMES as _flag_names
  File "C:\Python33\lib\dis.py", line 13, in <module>
    _have_code = (types.MethodType, types.FunctionType, types.CodeType, type)
AttributeError: 'module' object has no attribute 'MethodType'

C:\JMK\CurrentWork\CPH-3516>

It seems to be a problem with the types module. All the types seem non-existing.
msg205825 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-12-10 15:19
I suspect you may have a file shadowing the standard library's types.py; you can test with the following command:

python -c "import types;print(types.__file__)"

If the output from that is not "C:\Python33\lib\types.py", then you have another file shadowing it, which would best be renamed.
msg205828 - (view) Author: Jimmy Merrild Krag (beruic) Date: 2013-12-10 15:25
Just figured that out my self. Holy mother of ¤%#&%/! I'm stupid!
msg205829 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2013-12-10 15:30
People are bitten by this kind of thing all the time, but usually only once ;)
History
Date User Action Args
2022-04-11 14:57:55adminsetgithub: 64146
2013-12-10 15:30:46zach.waresetresolution: rejected -> not a bug
messages: + msg205829
2013-12-10 15:25:41beruicsetstatus: pending -> closed
resolution: rejected
messages: + msg205828
2013-12-10 15:19:43zach.waresetstatus: open -> pending
nosy: + zach.ware
messages: + msg205825

2013-12-10 14:49:44beruiccreate