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
Warnings in IDLE raise TypeError (such as attempting to import deprecated modules) #48293
Comments
In Python 2.6, attempting to import depecated modules in IDLE raises a
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import sets
File "C:\Python26\Lib\sets.py", line 85, in <module>
stacklevel=2)
File "C:\Python26\Lib\warnings.py", line 29, in _show_warning
file.write(formatwarning(message, category, filename, lineno, line))
TypeError: idle_formatwarning_subproc() takes exactly 4 arguments (5 given) The other modules give a similar trace. Normally, I wouldn't consider this a serious issue, but there are some |
Actually, it looks like ANY warning will raise this error in IDLE. For
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
warnings.warn('blah blah')
File "C:\Python26\Lib\warnings.py", line 29, in _show_warning
file.write(formatwarning(message, category, filename, lineno, line))
TypeError: idle_formatwarning_subproc() takes exactly 4 arguments (5 given) |
I should have checked this more carefully, but apparently you can still |
Okay, I think I've got it now:
|
This error is caused by line 27 in run.py: def idle_formatwarning_subproc(message, category, filename, lineno): needs to be changed to -- def idle_formatwarning_subproc(message, category, filename, lineno,
line=None): so that the function signature matches that of warnings.formatwarning |
Fixed in r66905. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: