Bug 2094006 - httpie fails to build with Python 3.11: Different enum reprs and different cookie order
Summary: httpie fails to build with Python 3.11: Different enum reprs and different co...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: httpie
Version: rawhide
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2098720 (view as bug list)
Depends On:
Blocks: PYTHON3.11 F37FTBFS F37FailsToInstall
TreeView+ depends on / blocked
 
Reported: 2022-06-06 14:32 UTC by Tomáš Hrnčiar
Modified: 2022-06-20 12:06 UTC (History)
5 users (show)

Fixed In Version: httpie-3.2.1-2.fc37
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-20 12:06:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github httpie httpie issues 1410 0 None open Python 3.11 test failures: Different enum reprs and different cookie order 2022-06-07 14:31:25 UTC

Description Tomáš Hrnčiar 2022-06-06 14:32:30 UTC
httpie fails to build with Python 3.11.0b3.

=================================== FAILURES ===================================
_______________________ test_url_colon_slash_slash_only ________________________

    def test_url_colon_slash_slash_only():
        r = http('://', tolerate_error_exit_status=True)
>       assert r.stderr.strip() == "http: error: InvalidURL: Invalid URL 'http://': No host supplied"
E       AssertionError: assert 'http: LogLev...host supplied' == 'http: error:...host supplied'
E         - http: error: InvalidURL: Invalid URL 'http://': No host supplied
E         ?        ^^^^
E         + http: LogLevel.ERROR: InvalidURL: Invalid URL 'http://': No host supplied
E         ?       ++++ ^^^^^^^^^

tests/test_cli.py:192: AssertionError
----------------------------- Captured stderr call -----------------------------

http: LogLevel.ERROR: InvalidURL: Invalid URL 'http://': No host supplied


_____________ TestQuietFlag.test_quiet_with_check_status_non_zero ______________

self = <tests.test_output.TestQuietFlag object at 0x7f129520e690>
httpbin = <pytest_httpbin.serve.Server object at 0x7f1295598cd0>

    def test_quiet_with_check_status_non_zero(self, httpbin):
        r = http(
            '--quiet', '--check-status', httpbin + '/status/500',
            tolerate_error_exit_status=True,
        )
>       assert 'http: warning: HTTP 500' in r.stderr
E       AssertionError: assert 'http: warning: HTTP 500' in '\nhttp: LogLevel.WARNING: HTTP 500 INTERNAL SERVER ERROR\n\n\n'
E        +  where '\nhttp: LogLevel.WARNING: HTTP 500 INTERNAL SERVER ERROR\n\n\n' = ''.stderr

tests/test_output.py:69: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [04/Jun/2022 08:29:25] "GET /status/500 HTTP/1.1" 500 0

http: LogLevel.WARNING: HTTP 500 INTERNAL SERVER ERROR


___________ TestQuietFlag.test_quiet_with_check_status_non_zero_pipe ___________

self = <tests.test_output.TestQuietFlag object at 0x7f129520c610>
httpbin = <pytest_httpbin.serve.Server object at 0x7f1295598cd0>

    def test_quiet_with_check_status_non_zero_pipe(self, httpbin):
        r = http(
            '--quiet', '--check-status', httpbin + '/status/500',
            tolerate_error_exit_status=True,
            env=MockEnvironment(stdout_isatty=False)
        )
>       assert 'http: warning: HTTP 500' in r.stderr
E       AssertionError: assert 'http: warning: HTTP 500' in '\nhttp: LogLevel.WARNING: HTTP 500 INTERNAL SERVER ERROR\n\n\n'
E        +  where '\nhttp: LogLevel.WARNING: HTTP 500 INTERNAL SERVER ERROR\n\n\n' = ''.stderr

tests/test_output.py:77: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [04/Jun/2022 08:29:25] "GET /status/500 HTTP/1.1" 500 0

http: LogLevel.WARNING: HTTP 500 INTERNAL SERVER ERROR


________ TestQuietFlag.test_quiet_quiet_with_check_status_non_zero_pipe ________

self = <tests.test_output.TestQuietFlag object at 0x7f12953fb910>
httpbin = <pytest_httpbin.serve.Server object at 0x7f1295598cd0>

    def test_quiet_quiet_with_check_status_non_zero_pipe(self, httpbin):
        r = http(
            '--quiet', '--quiet', '--check-status', httpbin + '/status/500',
            tolerate_error_exit_status=True,
            env=MockEnvironment(stdout_isatty=False)
        )
>       assert 'http: warning: HTTP 500' in r.stderr
E       AssertionError: assert 'http: warning: HTTP 500' in '\nhttp: LogLevel.WARNING: HTTP 500 INTERNAL SERVER ERROR\n\n\n'
E        +  where '\nhttp: LogLevel.WARNING: HTTP 500 INTERNAL SERVER ERROR\n\n\n' = ''.stderr

tests/test_output.py:92: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [04/Jun/2022 08:29:25] "GET /status/500 HTTP/1.1" 500 0

http: LogLevel.WARNING: HTTP 500 INTERNAL SERVER ERROR


_ TestCookieStorage.test_existing_and_new_cookies_sent_in_request[new=bar;chocolate=milk-new_cookies_dict1-chocolate=milk; cookie1=foo; cookie2=foo; new=bar] _

self = <tests.test_sessions.TestCookieStorage object at 0x7f1295297ad0>
new_cookies = 'new=bar;chocolate=milk'
new_cookies_dict = {'chocolate': 'milk', 'new': 'bar'}
expected = 'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
httpbin = <pytest_httpbin.serve.Server object at 0x7f1295598cd0>

    @pytest.mark.parametrize(
        'new_cookies, new_cookies_dict, expected',
        [(
            'new=bar',
            {'new': 'bar'},
            'cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar;chocolate=milk',
            {'new': 'bar', 'chocolate': 'milk'},
            'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar; chocolate=milk',
            {'new': 'bar', 'chocolate': 'milk'},
            'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar;; chocolate=milk;;;',
            {'new': 'bar', 'chocolate': 'milk'},
            'cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar; chocolate=milk;;;',
            {'new': 'bar', 'chocolate': 'milk'},
            'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
        )
        ]
    )
    def test_existing_and_new_cookies_sent_in_request(self, new_cookies, new_cookies_dict, expected, httpbin):
        r = http(
            '--session', str(self.session_path),
            '--print=H',
            httpbin.url,
            'Cookie:' + new_cookies,
        )
        # Note: cookies in response are in alphabetical order
>       assert f'Cookie: {expected}' in r
E       AssertionError: assert 'Cookie: chocolate=milk; cookie1=foo; cookie2=foo; new=bar' in 'GET / HTTP/1.1\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, br\r\nConnection: keep-alive\r\nCookie: cookie1=foo; cookie2=foo; new=bar; chocolate=milk\r\nHost: 127.0.0.1:40833\r\nUser-Agent: HTTPie/3.2.1\r\n\r\n'

tests/test_sessions.py:485: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [04/Jun/2022 08:30:23] "GET / HTTP/1.1" 200 12144
_ TestCookieStorage.test_existing_and_new_cookies_sent_in_request[new=bar; chocolate=milk-new_cookies_dict2-chocolate=milk; cookie1=foo; cookie2=foo; new=bar] _

self = <tests.test_sessions.TestCookieStorage object at 0x7f1295294410>
new_cookies = 'new=bar; chocolate=milk'
new_cookies_dict = {'chocolate': 'milk', 'new': 'bar'}
expected = 'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
httpbin = <pytest_httpbin.serve.Server object at 0x7f1295598cd0>

    @pytest.mark.parametrize(
        'new_cookies, new_cookies_dict, expected',
        [(
            'new=bar',
            {'new': 'bar'},
            'cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar;chocolate=milk',
            {'new': 'bar', 'chocolate': 'milk'},
            'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar; chocolate=milk',
            {'new': 'bar', 'chocolate': 'milk'},
            'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar;; chocolate=milk;;;',
            {'new': 'bar', 'chocolate': 'milk'},
            'cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar; chocolate=milk;;;',
            {'new': 'bar', 'chocolate': 'milk'},
            'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
        )
        ]
    )
    def test_existing_and_new_cookies_sent_in_request(self, new_cookies, new_cookies_dict, expected, httpbin):
        r = http(
            '--session', str(self.session_path),
            '--print=H',
            httpbin.url,
            'Cookie:' + new_cookies,
        )
        # Note: cookies in response are in alphabetical order
>       assert f'Cookie: {expected}' in r
E       AssertionError: assert 'Cookie: chocolate=milk; cookie1=foo; cookie2=foo; new=bar' in 'GET / HTTP/1.1\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, br\r\nConnection: keep-alive\r\nCookie: cookie1=foo; cookie2=foo; new=bar; chocolate=milk\r\nHost: 127.0.0.1:40833\r\nUser-Agent: HTTPie/3.2.1\r\n\r\n'

tests/test_sessions.py:485: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [04/Jun/2022 08:30:23] "GET / HTTP/1.1" 200 12144
_ TestCookieStorage.test_existing_and_new_cookies_sent_in_request[new=bar; chocolate=milk;;;-new_cookies_dict4-chocolate=milk; cookie1=foo; cookie2=foo; new=bar] _

self = <tests.test_sessions.TestCookieStorage object at 0x7f1295294c50>
new_cookies = 'new=bar; chocolate=milk;;;'
new_cookies_dict = {'chocolate': 'milk', 'new': 'bar'}
expected = 'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
httpbin = <pytest_httpbin.serve.Server object at 0x7f1295598cd0>

    @pytest.mark.parametrize(
        'new_cookies, new_cookies_dict, expected',
        [(
            'new=bar',
            {'new': 'bar'},
            'cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar;chocolate=milk',
            {'new': 'bar', 'chocolate': 'milk'},
            'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar; chocolate=milk',
            {'new': 'bar', 'chocolate': 'milk'},
            'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar;; chocolate=milk;;;',
            {'new': 'bar', 'chocolate': 'milk'},
            'cookie1=foo; cookie2=foo; new=bar'
        ),
            (
            'new=bar; chocolate=milk;;;',
            {'new': 'bar', 'chocolate': 'milk'},
            'chocolate=milk; cookie1=foo; cookie2=foo; new=bar'
        )
        ]
    )
    def test_existing_and_new_cookies_sent_in_request(self, new_cookies, new_cookies_dict, expected, httpbin):
        r = http(
            '--session', str(self.session_path),
            '--print=H',
            httpbin.url,
            'Cookie:' + new_cookies,
        )
        # Note: cookies in response are in alphabetical order
>       assert f'Cookie: {expected}' in r
E       AssertionError: assert 'Cookie: chocolate=milk; cookie1=foo; cookie2=foo; new=bar' in 'GET / HTTP/1.1\r\nAccept: */*\r\nAccept-Encoding: gzip, deflate, br\r\nConnection: keep-alive\r\nCookie: cookie1=foo; cookie2=foo; new=bar; chocolate=milk\r\nHost: 127.0.0.1:40833\r\nUser-Agent: HTTPie/3.2.1\r\n\r\n'

tests/test_sessions.py:485: AssertionError
----------------------------- Captured stderr call -----------------------------
127.0.0.1 - - [04/Jun/2022 08:30:23] "GET / HTTP/1.1" 200 12144
=========================== short test summary info ============================
FAILED tests/test_cli.py::test_url_colon_slash_slash_only - AssertionError: a...
FAILED tests/test_output.py::TestQuietFlag::test_quiet_with_check_status_non_zero
FAILED tests/test_output.py::TestQuietFlag::test_quiet_with_check_status_non_zero_pipe
FAILED tests/test_output.py::TestQuietFlag::test_quiet_quiet_with_check_status_non_zero_pipe
FAILED tests/test_sessions.py::TestCookieStorage::test_existing_and_new_cookies_sent_in_request[new=bar;chocolate=milk-new_cookies_dict1-chocolate=milk; cookie1=foo; cookie2=foo; new=bar]
FAILED tests/test_sessions.py::TestCookieStorage::test_existing_and_new_cookies_sent_in_request[new=bar; chocolate=milk-new_cookies_dict2-chocolate=milk; cookie1=foo; cookie2=foo; new=bar]
FAILED tests/test_sessions.py::TestCookieStorage::test_existing_and_new_cookies_sent_in_request[new=bar; chocolate=milk;;;-new_cookies_dict4-chocolate=milk; cookie1=foo; cookie2=foo; new=bar]
= 7 failed, 990 passed, 25 skipped, 2 xfailed, 2 xpassed, 331 warnings in 85.55s (0:01:25) =

The failure is likely caused by enhanced error locations in tracebacks.

https://docs.python.org/3.11/whatsnew/3.11.html#enhanced-error-locations-in-tracebacks
https://docs.python.org/3.11/whatsnew/3.11.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.11/fedora-rawhide-x86_64/04493796-httpie/

For all our attempts to build httpie with Python 3.11, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/httpie/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.11:
https://copr.fedorainfracloud.org/coprs/g/python/python3.11/

Let us know here if you have any questions.

Python 3.11 is planned to be included in Fedora 37. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.11.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2022-06-06 15:12:59 UTC
httpie is a leaf package. I will report this upstream, but this can wait until after the mass rebuild.

Comment 2 Miro Hrončok 2022-06-07 14:31:25 UTC
Reported to https://github.com/httpie/httpie/issues/1410

Comment 3 Miro Hrončok 2022-06-20 10:14:49 UTC
*** Bug 2098720 has been marked as a duplicate of this bug. ***

Comment 4 Fedora Update System 2022-06-20 12:04:28 UTC
FEDORA-2022-2dba32ccc7 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-2dba32ccc7

Comment 5 Fedora Update System 2022-06-20 12:06:43 UTC
FEDORA-2022-2dba32ccc7 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.