classification
Title: The type of ob_exports in PyByteArrayObject become Py_ssize_t.
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: serhiy.storchaka, shihai1991
Priority: normal Keywords: patch

Created on 2019-10-13 14:57 by shihai1991, last changed 2019-10-21 06:32 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 16746 merged shihai1991, 2019-10-13 14:59
Messages (6)
msg354586 - (view) Author: hai shi (shihai1991) * Date: 2019-10-13 14:57
for a code example:
```
v = []
b = bytearray(0xffff)
for i in range(2**31+1)
    # the ob_exports would be overflow in 32 bit machine when i = 2**31.
    v.append(memoryview(b))
```
IMHO, i thought converting the type of ob_exports to Py_ssize_t is fine.

PS: I have no actual user scenario.
msg354587 - (view) Author: hai shi (shihai1991) * Date: 2019-10-13 15:03
sorry, typo error.
# the ob_exports would be overflow in 32 bit machine when i = 2**31.
-->
# the ob_exports would be overflow in 64 bit machine when i = 2**31.
msg354866 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-10-18 07:39
See also array and mmap.
msg354913 - (view) Author: hai shi (shihai1991) * Date: 2019-10-18 17:19
Thanks, Serhiy, you are right.
msg355023 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-10-21 06:31
New changeset 06cd5b6acd98205adae1a3ea4223e88f38ad55ab by Serhiy Storchaka (Hai Shi) in branch 'master':
bpo-38465: Convert the type of exports counters to Py_ssize_t. (GH-16746)
https://github.com/python/cpython/commit/06cd5b6acd98205adae1a3ea4223e88f38ad55ab
msg355024 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-10-21 06:32
Thank you for your contribution hai shi!
History
Date User Action Args
2019-10-21 06:32:44serhiy.storchakasetstatus: open -> closed
resolution: fixed
messages: + msg355024

stage: patch review -> resolved
2019-10-21 06:31:50serhiy.storchakasetmessages: + msg355023
2019-10-18 17:19:18shihai1991setmessages: + msg354913
2019-10-18 07:39:20serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg354866
2019-10-13 15:03:36shihai1991setmessages: + msg354587
2019-10-13 14:59:28shihai1991setkeywords: + patch
stage: patch review
pull_requests: + pull_request16322
2019-10-13 14:57:15shihai1991create