Repository navigation
gh-128816: fix an import warning in test_doctest.py when importing re… - #128817
Conversation
…ing readline in WASI
serhiy-storchaka
left a comment
There was a problem hiding this comment.
LGTM.
But it seems that these methods are never called (only checked for existence). I would raise an AssertionError to ensure that they are not called.
|
I believe they are called, eg when attempting to import readline and it is missing. I will check |
@serhiy-storchaka I checked and both functions are called, not just checked for existence |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
Oh, I missed that it is only reproducible if readline is not available. That is why I was not able to reproduce this issue.
LGTM.
|
thanks for the review, but I can't merge it |
serhiy-storchaka
left a comment
There was a problem hiding this comment.
On other hand, the test now emit a different warning (even if readline is available):
test_lineendings (test.test_doctest.test_doctest)
Doctest: test.test_doctest.test_doctest.test_lineendings ... .../Lib/test/test_doctest/test_doctest.py:2887: DeprecationWarning: importlib.abc.ResourceLoader is deprecated in favour of supporting resource loading through importlib.resources.abc.ResourceReader.
self.importer = TestImporter()
ok
And it fails with -Werror.
So this is not a complete fix.
This reverts commit 9b850e7.
|
I have made the requested changes; please review again |
|
Thanks for making the requested changes! @serhiy-storchaka: please review the changes made to this pull request. |
|
Thanks @graingert for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
|
Thanks @graingert for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @graingert for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
* Fix a deprecation warning for using importlib.resources.abc.ResourceReader. * Fix an import warning when importing readline (if it has not yet been imported). (cherry picked from commit 599be68) Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* Fix a deprecation warning for using importlib.resources.abc.ResourceReader. * Fix an import warning when importing readline (if it has not yet been imported). (cherry picked from commit 599be68) Co-authored-by: Thomas Grainger <tagrain@gmail.com>
|
GH-128870 is a backport of this pull request to the 3.13 branch. |
|
GH-128871 is a backport of this pull request to the 3.12 branch. |
* Fix a deprecation warning for using importlib.resources.abc.ResourceReader. * Fix an import warning when importing readline (if it has not yet been imported). (cherry picked from commit 599be68) Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* Fix a deprecation warning for using importlib.resources.abc.ResourceReader. * Fix an import warning when importing readline (if it has not yet been imported). (cherry picked from commit 599be68) Co-authored-by: Thomas Grainger <tagrain@gmail.com>
…adline in WASI