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

3.11.5 test_httpservers fails on unhandled DeprecationWarning ("invalid escape sequence '\\?'") #108569

Closed
2 tasks done
dvzrv opened this issue Aug 28, 2023 · 7 comments
Closed
2 tasks done
Labels
tests Tests in the Lib/test dir topic-parser type-bug An unexpected behavior, bug, or error

Comments

@dvzrv
Copy link

dvzrv commented Aug 28, 2023

Bug report

Checklist

  • I am confident this is a bug in CPython, not a bug in a third-party project
  • I have searched the CPython issue tracker,
    and am confident this bug has not been reported before

CPython versions tested on:

3.11

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

Python 3.11.3 (main, Jun 5 2023, 09:32:32) [GCC 13.1.1 20230429]

A clear and concise description of the bug:

Hi! When attempting to upgrade the python package for Arch Linux to 3.11.5 I ran into the following test issue:

[..]
test.test_httpservers
FAIL

======================================================================
FAIL: test_all (test.test___all__.AllTest.test_all)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/build/python/src/Python-3.11.5/Lib/test/test___all__.py", line 129, in test_all
    self.check_all(modname)
  File "/build/python/src/Python-3.11.5/Lib/test/test___all__.py", line 43, in check_all
    with warnings_helper.check_warnings(
  File "/build/python/src/Python-3.11.5/Lib/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/build/python/src/Python-3.11.5/Lib/test/support/warnings_helper.py", line 185, in _filterwarnings
    raise AssertionError("unhandled warning %s" % reraise[0])
AssertionError: unhandled warning {message : DeprecationWarning("invalid escape sequence '\\?'"), category : 'DeprecationWarning', filename : '/build/python/src/Python-3.11.5/Lib/test/test_httpservers.py', lineno : 445, line : None}

----------------------------------------------------------------------
Ran 1 test in 0.621s

FAILED (failures=1)
test test___all__ failed
0:00:05 load avg: 3.34 [ 12/432/1] test___future__ -- test___all__ failed (1 failure)
test_attributes (test.test___future__.FutureTest.test_attributes) ... ok
test_names (test.test___future__.FutureTest.test_names) ... ok

----------------------------------------------------------------------
Ran 2 tests in 0.000s
[..]

Full build and check logs:
python-3.11.5-1-x86_64-build.log
python-3.11.5-1-x86_64-check.log

Build script for the package: https://gitlab.archlinux.org/archlinux/packaging/packages/python/-/blob/main/PKGBUILD

cc @felixonmars

@dvzrv dvzrv added the type-bug An unexpected behavior, bug, or error label Aug 28, 2023
@hugovk
Copy link
Member

hugovk commented Aug 28, 2023

The f-string was turned into a raw f-string for main and 3.12, but not 3.11:

@pablogsal @AlexWaygood Shall we backport it to 3.11?

@AlexWaygood AlexWaygood added tests Tests in the Lib/test dir topic-parser labels Aug 28, 2023
@AlexWaygood
Copy link
Member

AlexWaygood commented Aug 28, 2023

@pablogsal @AlexWaygood Shall we backport it to 3.11?

That makes sense to me; the change is very low-risk 👍

@dvzrv, are you running your tests with -W/-Werror? (I'm curious why we're not seeing the same test failures in CI over at CPython!)

@pablogsal
Copy link
Member

pablogsal commented Aug 28, 2023

Let's do the backport! 👍

Also let's investigate as well why we are didn't experience this in our own Ci. 🤔

@AlexWaygood
Copy link
Member

I triggered the backport, and I've enabled automerge:

@dvzrv
Copy link
Author

dvzrv commented Aug 28, 2023

@dvzrv, are you running your tests with -W/-Werror? (I'm curious why we're not seeing the same test failures in CI over at CPython!)

Not that I am aware of (definitely not explicitly).

Rebuilding with the patch applied now to see where this leads and will report back. Thanks for the super quick responses here!

@dvzrv
Copy link
Author

dvzrv commented Aug 28, 2023

Building with #108576 applied on top of 3.11.5 fixes the issue for us. Thank you! :)

@dvzrv dvzrv closed this as completed Aug 28, 2023
@hugovk
Copy link
Member

hugovk commented Aug 29, 2023

Also let's investigate as well why we are didn't experience this in our own Ci. 🤔

Because we're no longer running Lib/test/test___all__.py on the CI.

Here's the last build before the backport (33eee43):

https://github.com/python/cpython/actions/runs/6000276301/job/16272033246

Checking out 33eee43 locally, building and running the test fails:

❯ ./python.exe ./Lib/test/test___all__.py
__hello__
__phello__
__phello__.ham
...
test.test_http_cookies
test.test_httplib
test.test_httpservers
F
======================================================================
FAIL: test_all (__main__.AllTest.test_all)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/hugo/github/cpython/./Lib/test/test___all__.py", line 129, in test_all
    self.check_all(modname)
  File "/Users/hugo/github/cpython/./Lib/test/test___all__.py", line 43, in check_all
    with warnings_helper.check_warnings(
  File "/Users/hugo/github/cpython/Lib/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/Users/hugo/github/cpython/Lib/test/support/warnings_helper.py", line 185, in _filterwarnings
    raise AssertionError("unhandled warning %s" % reraise[0])
AssertionError: unhandled warning {message : DeprecationWarning("invalid escape sequence '\\?'"), category : 'DeprecationWarning', filename : '/Users/hugo/github/cpython/Lib/test/test_httpservers.py', lineno : 445, line : None}

----------------------------------------------------------------------
Ran 1 test in 1.284s

FAILED (failures=1)

(Note: running it a second time passes, some intermediary files need to be deleted first.)


test___all___ was added to the CI in #26640 and skipped in #30897 (both by @pablogsal) and then skipped in a different way in #31632.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-parser type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

4 participants