python / python/cpython

Assertion failure in Objects/unicodeobject.c `_PyUnicode_DecodeUnicodeEscapeInternal2: Assertion 'end - s <= writer.size - writer.pos' failed`

Đang mở
#141,336 4 bình luận 0 reaction 1 người được giao Xem trên GitHub

@serhiy-storchaka đang làm issue này rồi.

Từ ngày 10/11/2025.

interpreter-core topic-unicode type-crash
Ngôn ngữ chính
Python
Star
77.2k
Fork
35.9k
Chỉ số merge pull request
Chỉ số pull request đang chờ

Mô tả

Bug report

Bug description:
import codecs

decode = codecs.unicode_escape_decode
data = {b'\\x0': (b'\xe2\x98\x83', 0)}

def mutating(exc):
    key = exc.object[:exc.end]
    r = data.get(key)
    if r is not None:
        return ('Є', r[1])

codecs.register_error('test.mutating2', mutating)

input_obj = b'\\x0n\\z'
result, length = decode(input_obj, 'test.mutating2')
python: ../Objects/unicodeobject.c:6687: _PyUnicode_DecodeUnicodeEscapeInternal2: Assertion `end - s <= writer.size - writer.pos' failed.
Aborted (core dumped)
CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs
  • gh-141344

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.