4 Commits

Author SHA256 Message Date
44f56cfdfb Accepting request 1301436 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1301436
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-h2?expand=0&rev=18
2025-08-27 19:34:08 +00:00
9ee9289968 - Update to 4.3.0 (fixes CVE-2025-57804, bsc#1248737)
* API Changes (Backward Incompatible)
    - Reject header names and values containing illegal characters, based on
      RFC 9113, section 8.2.1. The main Python API is compatible, but some
      previously valid requests/response headers might now be blocked. Use the
      `validate_inbound_headers` config option if needed. Thanks to Sebastiano
      Sartor (sebsrt) for the report.
  * API Changes (Backward Compatible)
    - h2 events now have tighter type bounds, e.g. `stream_id` is guaranteed to
      not be `None` for most events now. This simplifies downstream type
      checking.
    - Various typing-related improvements.
  * Bugfixes
    - Fix error value when opening a new stream on too many open streams.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-h2?expand=0&rev=39
2025-08-26 12:40:51 +00:00
b23e732ec8 Accepting request 1245093 from devel:languages:python
OBS-URL: https://build.opensuse.org/request/show/1245093
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-h2?expand=0&rev=17
2025-02-11 20:22:18 +00:00
7200eea356 Accepting request 1245024 from home:glaubitz:branches:devel:languages:python
- Update to 4.2.0
  * Support for Python 3.6 has been removed.
  * Support for Python 3.7 has been removed.
  * Support for Python 3.8 has been removed.
  * Remove mistakenly set `max_inbound_frame_size` attribute on `H2Stream`.
  * Support for Python 3.11 has been added.
  * Support for Python 3.12 has been added.
  * Support for Python 3.13 has been added.
  * Add an ability to send outbound cookies separately to improve headers compression.
  * Updated packaging and testing infrastructure.
  * Fix repr() checks for Python 3.11
  * Fix asyncio / wsgi examples.
  * Clarify docs on using curl with http2.
- Adjust path for patching tests/conftest.py
- Drop fix-repr-checks-for-py311.patch, merged upstream
- Switch build system from setuptools to pyproject.toml
  * Add python-pip and python-wheel to BuildRequires
  * Replace %python_build with %pyproject_wheel
  * Replace %python_install with %pyproject_install

OBS-URL: https://build.opensuse.org/request/show/1245024
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-h2?expand=0&rev=37
2025-02-11 12:41:29 +00:00
5 changed files with 51 additions and 119 deletions

View File

@@ -1,107 +0,0 @@
From 8952c91606cd014720ccf202a25b5ee1fbed1591 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m@gmail.com>
Date: Sun, 3 Jul 2022 12:05:05 +0200
Subject: [PATCH] Fix repr() checks for Python 3.11
In Python 3.11, repr() was modified, this commit fixes the
assertions to match the new repr() behavior.
Fix #1268
---
test/test_events.py | 62 ++++++++++++++++++++++++++++++++-------------
1 file changed, 44 insertions(+), 18 deletions(-)
diff --git a/test/test_events.py b/test/test_events.py
index a6e8d8379..c790fbaa0 100644
--- a/test/test_events.py
+++ b/test/test_events.py
@@ -207,11 +207,18 @@ def test_remotesettingschanged_repr(self):
),
}
- assert repr(e) == (
- "<RemoteSettingsChanged changed_settings:{ChangedSetting("
- "setting=SettingCodes.INITIAL_WINDOW_SIZE, original_value=65536, "
- "new_value=32768)}>"
- )
+ if sys.version_info >= (3, 11):
+ assert repr(e) == (
+ "<RemoteSettingsChanged changed_settings:{ChangedSetting("
+ "setting=4, original_value=65536, "
+ "new_value=32768)}>"
+ )
+ else:
+ assert repr(e) == (
+ "<RemoteSettingsChanged changed_settings:{ChangedSetting("
+ "setting=SettingCodes.INITIAL_WINDOW_SIZE, original_value=65536, "
+ "new_value=32768)}>"
+ )
def test_pingreceived_repr(self):
"""
@@ -249,10 +256,16 @@ def test_streamreset_repr(self):
e.error_code = h2.errors.ErrorCodes.ENHANCE_YOUR_CALM
e.remote_reset = False
- assert repr(e) == (
- "<StreamReset stream_id:919, "
- "error_code:ErrorCodes.ENHANCE_YOUR_CALM, remote_reset:False>"
- )
+ if sys.version_info >= (3, 11):
+ assert repr(e) == (
+ "<StreamReset stream_id:919, "
+ "error_code:11, remote_reset:False>"
+ )
+ else:
+ assert repr(e) == (
+ "<StreamReset stream_id:919, "
+ "error_code:ErrorCodes.ENHANCE_YOUR_CALM, remote_reset:False>"
+ )
def test_pushedstreamreceived_repr(self):
"""
@@ -284,11 +297,18 @@ def test_settingsacknowledged_repr(self):
),
}
- assert repr(e) == (
- "<SettingsAcknowledged changed_settings:{ChangedSetting("
- "setting=SettingCodes.INITIAL_WINDOW_SIZE, original_value=65536, "
- "new_value=32768)}>"
- )
+ if sys.version_info >= (3, 11):
+ assert repr(e) == (
+ "<SettingsAcknowledged changed_settings:{ChangedSetting("
+ "setting=4, original_value=65536, "
+ "new_value=32768)}>"
+ )
+ else:
+ assert repr(e) == (
+ "<SettingsAcknowledged changed_settings:{ChangedSetting("
+ "setting=SettingCodes.INITIAL_WINDOW_SIZE, original_value=65536, "
+ "new_value=32768)}>"
+ )
def test_priorityupdated_repr(self):
"""
@@ -318,10 +338,16 @@ def test_connectionterminated_repr(self, additional_data, data_repr):
e.last_stream_id = 33
e.additional_data = additional_data
- assert repr(e) == (
- "<ConnectionTerminated error_code:ErrorCodes.INADEQUATE_SECURITY, "
- "last_stream_id:33, additional_data:%s>" % data_repr
- )
+ if sys.version_info >= (3, 11):
+ assert repr(e) == (
+ "<ConnectionTerminated error_code:12, "
+ "last_stream_id:33, additional_data:%s>" % data_repr
+ )
+ else:
+ assert repr(e) == (
+ "<ConnectionTerminated error_code:ErrorCodes.INADEQUATE_SECURITY, "
+ "last_stream_id:33, additional_data:%s>" % data_repr
+ )
def test_alternativeserviceavailable_repr(self):
"""

BIN
h2-4.1.0.tar.gz (Stored with Git LFS)

Binary file not shown.

3
h2-4.3.0.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6c59efe4323fa18b47a632221a1888bd7fde6249819beda254aeca909f221bf1
size 2152026

View File

@@ -1,3 +1,44 @@
-------------------------------------------------------------------
Tue Aug 26 11:28:51 UTC 2025 - Nico Krapp <nico.krapp@suse.com>
- Update to 4.3.0 (fixes CVE-2025-57804, bsc#1248737)
* API Changes (Backward Incompatible)
- Reject header names and values containing illegal characters, based on
RFC 9113, section 8.2.1. The main Python API is compatible, but some
previously valid requests/response headers might now be blocked. Use the
`validate_inbound_headers` config option if needed. Thanks to Sebastiano
Sartor (sebsrt) for the report.
* API Changes (Backward Compatible)
- h2 events now have tighter type bounds, e.g. `stream_id` is guaranteed to
not be `None` for most events now. This simplifies downstream type
checking.
- Various typing-related improvements.
* Bugfixes
- Fix error value when opening a new stream on too many open streams.
-------------------------------------------------------------------
Tue Feb 11 09:03:44 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
- Update to 4.2.0
* Support for Python 3.6 has been removed.
* Support for Python 3.7 has been removed.
* Support for Python 3.8 has been removed.
* Remove mistakenly set `max_inbound_frame_size` attribute on `H2Stream`.
* Support for Python 3.11 has been added.
* Support for Python 3.12 has been added.
* Support for Python 3.13 has been added.
* Add an ability to send outbound cookies separately to improve headers compression.
* Updated packaging and testing infrastructure.
* Fix repr() checks for Python 3.11
* Fix asyncio / wsgi examples.
* Clarify docs on using curl with http2.
- Adjust path for patching tests/conftest.py
- Drop fix-repr-checks-for-py311.patch, merged upstream
- Switch build system from setuptools to pyproject.toml
* Add python-pip and python-wheel to BuildRequires
* Replace %python_build with %pyproject_wheel
* Replace %python_install with %pyproject_install
-------------------------------------------------------------------
Fri Apr 21 12:26:00 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-h2
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,22 +16,20 @@
#
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
%{?sle15_python_module_pythons}
Name: python-h2
Version: 4.1.0
Version: 4.3.0
Release: 0
Summary: HTTP/2 State-Machine based protocol implementation
License: MIT
URL: https://github.com/python-hyper/hyper-h2
Source0: https://files.pythonhosted.org/packages/source/h/h2/h2-%{version}.tar.gz
# Taken from https://github.com/python-hyper/h2/pull/1274
Patch1: fix-repr-checks-for-py311.patch
BuildRequires: %{python_module hpack >= 2.3}
BuildRequires: %{python_module hyperframe >= 6.0}
BuildRequires: %{python_module hypothesis >= 5.49}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-hpack >= 2.3
@@ -56,13 +54,13 @@ hypothesis.settings.register_profile(
deadline=5000,
suppress_health_check=[hypothesis.HealthCheck.too_slow]
)
" >> test/conftest.py
" >> tests/conftest.py
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check