{"record":{"id":"f8220664280ba03c","repo":"sqlmapproject/sqlmap","slug":"expected-bytes-text-value-got-s","errorCode":null,"errorMessage":"expected bytes/text value, got %s","messagePattern":"expected bytes/text value, got (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"lib/request/http2.py","lineNumber":257,"sourceCode":"    pass\n\n\nclass H2TransportError(H2Error):\n    pass\n\n\nclass _UnprocessedStream(H2Error):\n    \"\"\"The peer explicitly guaranteed that the request stream was not processed.\"\"\"\n\n\ndef _as_bytes(value):\n    if isinstance(value, bytes):\n        return value\n    if isinstance(value, bytearray):\n        return bytes(value)\n    if isinstance(value, text_type):\n        return value.encode(\"latin-1\")\n    raise TypeError(\"expected bytes/text value, got %s\" % type(value).__name__)\n\n\ndef encode_frame(ftype, flags, stream_id, payload=b\"\"):\n    \"\"\"Serialize an HTTP/2 frame.\n\n    >>> decode_frame_header(encode_frame(HEADERS, FLAG_END_HEADERS, 1, b'abc')[:9])\n    (3, 1, 4, 1)\n    \"\"\"\n    payload = _as_bytes(payload)\n    if not (0 <= ftype <= 0xff and 0 <= flags <= 0xff):\n        raise ValueError(\"frame type and flags must fit in one octet\")\n    if not (0 <= stream_id <= MAX_STREAM_ID):\n        raise ValueError(\"stream id must be between 0 and 2^31-1\")\n    if len(payload) > MAX_FRAME_SIZE:\n        raise ValueError(\"frame payload exceeds 24-bit length\")\n    header = struct.pack(\"!I\", len(payload))[1:]\n    header += struct.pack(\"!BBI\", ftype, flags, stream_id)\n    return header + payload","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/request/http2.py#L239-L275","documentation":"Error \"expected bytes/text value, got %s\" thrown in sqlmapproject/sqlmap.","triggerScenarios":"Thrown at lib/request/http2.py:257 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}