Skip to content

Assertion failure in Objects/rangeobject.c compute_range_length: Assertion PyLong_Check(start)' failed #141312

@YuanchengJiang

Description

@YuanchengJiang

Bug report

Bug description:

import pickle

for proto in range(pickle.HIGHEST_PROTOCOL + 1):
    it = iter(range(0x80000000 ** 32 + -(2**15)))
    it.__setstate__(2 ** -(2**15) + 1)
    d = pickle.dumps(it, proto)
python: ../Objects/rangeobject.c:243: compute_range_length: Assertion `PyLong_Check(start)' failed.
Aborted (core dumped)

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Labels

interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions