nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: dpkp/kafka-python
Pull request #2483 (2025-02-16 06:07:49)

Do not validate snappy xerial header version and compat fields
Fix for #2414 


Patch:
diff --git a/kafka/codec.py b/kafka/codec.py
index c740a18..b73df06 100644
--- a/kafka/codec.py
+++ b/kafka/codec.py
@@ -193,8 +193,15 @@ def _detect_xerial_stream(payload):
     """
 
     if len(payload) > 16:
-        header = struct.unpack('!' + _XERIAL_V1_FORMAT, bytes(payload)[:16])
-        return header == _XERIAL_V1_HEADER
+        magic = struct.unpack('!' + _XERIAL_V1_FORMAT[:8], bytes(payload)[:8])
+        version, compat = struct.unpack('!' + _XERIAL_V1_FORMAT[8:], bytes(payload)[8:16])
+        # Until there is more than one way to do xerial blocking, the version + compat
+        # fields can be ignored. Also some producers (i.e., redpanda) are known to
+        # incorrectly encode these as little-endian, and that causes us to fail decoding
+        # when we otherwise would have succeeded.
+        # See https://github.com/dpkp/kafka-python/issues/2414
+        if magic == _XERIAL_V1_HEADER[:8]:
+            return True
     return False
 
 


Test patch:
diff --git a/test/test_codec.py b/test/test_codec.py
index e057074..24159c2 100644
--- a/test/test_codec.py
+++ b/test/test_codec.py
@@ -39,12 +39,14 @@ def test_snappy_detect_xerial():
     _detect_xerial_stream = kafka1.codec._detect_xerial_stream
 
     header = b'\x82SNAPPY\x00\x00\x00\x00\x01\x00\x00\x00\x01Some extra bytes'
+    redpanda_header = b'\x82SNAPPY\x00\x01\x00\x00\x00\x01\x00\x00\x00Some extra bytes'
     false_header = b'\x01SNAPPY\x00\x00\x00\x01\x00\x00\x00\x01'
     default_snappy = snappy_encode(b'foobar' * 50)
     random_snappy = snappy_encode(b'SNAPPY' * 50, xerial_compatible=False)
     short_data = b'\x01\x02\x03\x04'
 
     assert _detect_xerial_stream(header) is True
+    assert _detect_xerial_stream(redpanda_header) is True
     assert _detect_xerial_stream(b'') is False
     assert _detect_xerial_stream(b'\x00') is False
     assert _detect_xerial_stream(false_header) is False
Repository: dpkp/kafka-python
Pull request #2651 (2025-06-23 22:11:58)

Drop unused imports


Patch:
diff --git a/kafka/consumer/group.py b/kafka/consumer/group.py
index 4eb9e2a..5ac14eb 100644
--- a/kafka/consumer/group.py
+++ b/kafka/consumer/group.py
@@ -5,7 +5,7 @@ import logging
 import socket
 import time
 
-from kafka.errors import KafkaConfigurationError, KafkaTimeoutError, UnsupportedVersionError
+from kafka.errors import KafkaConfigurationError, UnsupportedVersionError
 
 from kafka.vendor import six
 
diff --git a/kafka/protocol/parser.py b/kafka/protocol/parser.py
index 4bc4273..8683a95 100644
--- a/kafka/protocol/parser.py
+++ b/kafka/protocol/parser.py
@@ -6,7 +6,7 @@ import logging
 import kafka.errors as Errors
 from kafka.protocol.find_coordinator import FindCoordinatorResponse
 from kafka.protocol.frame import KafkaBytes
-from kafka.protocol.types import Int32, TaggedFields
+from kafka.protocol.types import Int32
 from kafka.version import __version__
 
 log = logging.getLogger(__name__)


Test patch:
diff --git a/test/integration/test_admin_integration.py b/test/integration/test_admin_integration.py
index 1c38400..5292080 100644
--- a/test/integration/test_admin_integration.py
+++ b/test/integration/test_admin_integration.py
@@ -9,7 +9,7 @@ from time import time, sleep
 from kafka.admin import (
     ACLFilter, ACLOperation, ACLPermissionType, ResourcePattern, ResourceType, ACL, ConfigResource, ConfigResourceType)
 from kafka.errors import (
-        BrokerResponseError, KafkaError, NoError, CoordinatorNotAvailableError, NonEmptyGroupError,
+        BrokerResponseError, NoError, CoordinatorNotAvailableError, NonEmptyGroupError,
         GroupIdNotFoundError, OffsetOutOfRangeError, UnknownTopicOrPartitionError)
 
 
diff --git a/test/test_assignors.py b/test/test_assignors.py
index 858ef42..91d7157 100644
--- a/test/test_assignors.py
+++ b/test/test_assignors.py
@@ -9,8 +9,8 @@ import pytest
 from kafka.structs import TopicPartition
 from kafka.coordinator.assignors.range import RangePartitionAssignor
 from kafka.coordinator.assignors.roundrobin import RoundRobinPartitionAssignor
-from kafka.coordinator.assignors.sticky.sticky_assignor import StickyPartitionAssignor, StickyAssignorUserDataV1
-from kafka.coordinator.protocol import ConsumerProtocolMemberAssignment, ConsumerProtocolMemberMetadata
+from kafka.coordinator.assignors.sticky.sticky_assignor import StickyPartitionAssignor
+from kafka.coordinator.protocol import ConsumerProtocolMemberAssignment
 from kafka.vendor import six
Repository: tobie/specref
Pull request #518 (2019-03-12 15:43:13)

Update link to SCTE35
Updated the existing link, rather than add as a new version, as the 2016 edition has been replaced by a 2019 edition.


Patch:
diff --git a/refs/biblio.json b/refs/biblio.json
index 5a9138e91..43c5bec9c 100644
--- a/refs/biblio.json
+++ b/refs/biblio.json
@@ -2517,7 +2517,7 @@
     },
     "SCTE35": {
         "title": "Digital Program Insertion Cueing Message for Cable",
-        "href": "https://www.scte.org/SCTEDocs/Standards/SCTE%2035%202016.pdf",
+        "href": "https://www.scte.org/SCTEDocs/Standards/SCTE%2035%202019.pdf",
         "publisher": "ANSI/SCTE"
     },
     "SCTP-SDP": {
diff --git a/refs/wg21.json b/refs/wg21.json
index 3df5bba25..df61a478d 100644
--- a/refs/wg21.json
+++ b/refs/wg21.json
@@ -41615,6 +41615,13 @@
         "publisher": "WG21",
         "source": "https://wg21.link/index.json"
     },
+    "EDIT2772": {
+        "title": "Fix a bunch of faulty parallelism with \"either\".",
+        "href": "https://wg21.link/edit2772",
+        "status": "open",
+        "publisher": "WG21",
+        "source": "https://wg21.link/index.json"
+    },
     "EDIT278": {
         "title": "[basic.stc.dynamic] Don't italicize \"deallocated storage\".",
         "href": "https://wg21.link/edit278",
@@ -150600,6 +150607,9 @@
     "WG21-EDIT2771": {
         "aliasOf": "EDIT2771"
     },
+    "WG21-EDIT2772": {
+        "aliasOf": "EDIT2772"
+    },
     "WG21-EDIT278": {
         "aliasOf": "EDIT278"
     },


Test patch:
diff --git a/test/ref-list.json b/test/ref-list.json
index 25527410b..192b9e94e 100644
--- a/test/ref-list.json
+++ b/test/ref-list.json
@@ -9495,6 +9495,7 @@
     "EDIT277",
     "EDIT2770",
     "EDIT2771",
+    "EDIT2772",
     "EDIT278",
     "EDIT279",
     "EDIT28",
@@ -54083,6 +54084,7 @@
     "WG21-EDIT277",
     "WG21-EDIT2770",
     "WG21-EDIT2771",
+    "WG21-EDIT2772",
     "WG21-EDIT278",
     "WG21-EDIT279",
     "WG21-EDIT28",
Repository: stellar/rs-soroban-env
Pull request #1272 (2023-12-01 16:46:28)

Update stellar-xdr
### What
Update stellar-xdr.

### Why
I made changes to it.


Patch:
diff --git a/Cargo.lock b/Cargo.lock
index 87c395a9..bee3ab4c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -461,6 +461,12 @@ dependencies = [
  "windows-sys",
 ]
 
+[[package]]
+name = "escape-bytes"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3871d161fec5b6fade5fe7afe2e196b86839c5526a8d256c7b1a04dbbe5241a4"
+
 [[package]]
 name = "ethnum"
 version = "1.5.0"
@@ -1504,11 +1510,12 @@ dependencies = [
 [[package]]
 name = "stellar-xdr"
 version = "20.0.0-rc1"
-source = "git+https://github.com/stellar/rs-stellar-xdr?rev=d6f8ece2c89809d5e2800b9df64ae60787ee492b#d6f8ece2c89809d5e2800b9df64ae60787ee492b"
+source = "git+https://github.com/stellar/rs-stellar-xdr?rev=889d433c6069c7cdd63a9e4f391de06f5d8018ac#889d433c6069c7cdd63a9e4f391de06f5d8018ac"
 dependencies = [
  "arbitrary",
  "base64 0.13.1",
  "crate-git-revision",
+ "escape-bytes",
  "hex",
  "serde",
  "serde_with",
diff --git a/Cargo.toml b/Cargo.toml
index 1a14f689..cc21b6d9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -29,7 +29,7 @@ soroban-builtin-sdk-macros = { version = "=20.0.0-rc2", path = "soroban-builtin-
 [workspace.dependencies.stellar-xdr]
 version = "=20.0.0-rc1"
 git = "https://github.com/stellar/rs-stellar-xdr"
-rev = "d6f8ece2c89809d5e2800b9df64ae60787ee492b"
+rev = "889d433c6069c7cdd63a9e4f391de06f5d8018ac"
 default-features = false
 
 [workspace.dependencies.wasmi]
diff --git a/soroban-env-host/Cargo.toml b/soroban-env-host/Cargo.toml
index 36508d1e..2b3399bc 100644
--- a/soroban-env-host/Cargo.toml
+++ b/soroban-env-host/Cargo.toml
@@ -65,7 +65,7 @@ arbitrary = "=1.3.2"
 [dev-dependencies.stellar-xdr]
 version = "=20.0.0-rc1"
 git = "https://github.com/stellar/rs-stellar-xdr"
-rev = "d6f8ece2c89809d5e2800b9df64ae60787ee492b"
+rev = "889d433c6069c7cdd63a9e4f391de06f5d8018ac"
 default-features = false
 features = ["arbitrary"]
 


Test patch:
diff --git a/soroban-env-host/src/test/address.rs b/soroban-env-host/src/test/address.rs
index fd33509a..ad324162 100644
--- a/soroban-env-host/src/test/address.rs
+++ b/soroban-env-host/src/test/address.rs
@@ -5,7 +5,7 @@ use soroban_env_common::{
 };
 
 fn extract_string(host: &Host, s: StringObject) -> String {
-    host.visit_obj(s, |st: &ScString| Ok(st.0.to_string_lossy()))
+    host.visit_obj(s, |st: &ScString| Ok(st.0.to_string()))
         .unwrap()
 }