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
Test suite emits many DeprecationWarnings when -3 is enabled #51341
Comments
If the test suite is run with -3, many deprecation warnings are Even aside from the fact that many of these warnings being caused by Attached is a log of a complete test run with -3. |
I don't think it's so important that tests not raises -3 warnings, but |
I agree with Benjamin. We shouldn't release 2.7 w/ any of the standard I have made this a release blocker until we can create separate issues for |
FWIW I tried to filter out the test-related warnings using the following $ ./python -3 -W 'ignore::DeprecationWarning:test:0' -m test.regrtest |
I've fixed a bunch of them: aifc (r75407), test_atexit (r75408), bsddb |
Here is a record of stderr after a new regrtest run. |
(interestingly, one of the culprits for py3k warnings is lib2to3) |
Making this a deferred blocker so as not to clutter 2.6.4 release. |
Many fixes of modules and packages outside Lib/test Dev notes:
|
Patch for the compiler package and astgen.py tool. Basically: ==> def __init__(self, leftright, lineno=None): |
Patch for pprint: when keys are not the same type, "-3" emits warnings. Partial backport from Py3k. |
In issue7092_lib_many_fixes.diff: why did you change some of the warning messages? In issue7092_pprint.diff: I'm not sure these changes are right, because they could modify existing behaviour. Raymond, what do you think? |
Updated "lib_many_fixes" patch:
Ready for review and merge:
|
One thing: "lambda k: k in selfdata" can be replaced with |
I learned something. |
Looks good, thank you. |
Both patches have been committed in r77310. |
Still some "-3" warnings to silence: ./python -3m "collections" >/dev/null All these modules yield: There's also "bsddb" but it is deprecated. |
I think this warning is both annoying (cPickle is a legitimate module to use in 2.x, since pickle is much slower) and useless (2to3 should be able to do the module rename -- Benjamin, does it?). Therefore I suggest to remove this warning. |
You may be right, but keep in mind that cPickle and pickle are only *mostly* compatible with each other. There are uses of one which will not automatically work if you switch to the other. |
+1 to remove this boring cPickle message. cStringIO do not print such messages. |
|
The Big Patch™. It removes 99% of noisy deprecation messages. |
test_exceptions and test_pep352 fixed in r77913. |
test_unittest fixed in r77911. See also bpo-7837. |
In issue7092_test_support:
|
Docstring added. Notes:
|
Applied the syntax fixes in r77942. |
Silence the last warnings, using check_py3k_warnings. But we could provide a smaller patch, if bpo-7832 is fixed before. |
Checking the pybsddb 4.8.4devel with current trunk I still see this: """ OK """ Python 2.6.4 has the same issue too. |
It is because the "test_early_close" module calls resetwarnings(). You may change the test case with a context manager: with warnings.catch_warnings():
warnings.resetwarnings()
# test the warning |
I took part of Florent latest patch, changed a few things and committed it in r79023. |
Florent you are right, good catch. I can not use context managers because "with" is invalid syntax in python 2.3 and 2.4, that I must support for a while. I have implemented a context manager manually, following the description in PEP-343. This change is available in pybsddb 4.8.3+. I plan to integrate pybsddb 4.8.3+, see bpo-8156. |
More warnings silenced with r79165. |
other py3k warnings silenced with r79187 r79188 r79189 |
Now the "-Wd" and "-3" flags are active on some buildbots. Need to backport fixes from py3k branch for:
And test_multiprocessing is failing on: "sys.exc_clear() not supported in 3.x; use except clauses" |
Other py3k warnings: lib\distutils\util.py:209: DeprecationWarning: apply() not supported in 3.x; use func(*args, **kwargs) lib\distutils\command\build_ext.py:679: DeprecationWarning: apply() not supported in 3.x; use func(*args, **kwargs) lib\platform.py:1035: DeprecationWarning: dict.has_key() not supported in 3.x; use the in operator |
Fixed with r79558, except test_multiprocessing. |
Additional fixes: r79576, r79577, r79578 (idlelib package and some test modules) |
This issue is over, except for bpo-7723 which is tracked separately. |
Barry, is it OK if I backport this to 2.6 before the rc1? |
Hi Ezio, what's the status on this issue for 2.6.6rc1? |
I am removing this as a release blocker given all of Ezio's great work to get the test suite clean with -3. I will leave it up to him to actually close the issue once the work is complete. It no longer needs to block 2.6.6. |
I fixed the deprecation warnings on 2.6 in r83519, r83576-r83579, r83620-r83622, r83627-r83632, r83635, r83637-83642, r83652-83656, r83658, r83687. |
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: