[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-04-26 Thread Łukasz Langa

Change by Łukasz Langa :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-04-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset e1203e8001432a08b87b54867490beb19a694069 by Miss Islington (bot) 
in branch '3.8':
bpo-42924: Fix incorrect copy in bytearray_repeat (GH-24208) (#24212)
https://github.com/python/cpython/commit/e1203e8001432a08b87b54867490beb19a694069


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-04-26 Thread Łukasz Langa

Łukasz Langa  added the comment:


New changeset d0698c676ca1b7d34be4165a631bf4847583de76 by Miss Islington (bot) 
in branch '3.9':
bpo-42924: Fix incorrect copy in bytearray_repeat (GH-24208) (#24211)
https://github.com/python/cpython/commit/d0698c676ca1b7d34be4165a631bf4847583de76


--
nosy: +lukasz.langa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23039
pull_request: https://github.com/python/cpython/pull/24212

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +23038
pull_request: https://github.com/python/cpython/pull/24211

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 61d8c54f43a7871d016f98b38f86858817d927d5 by Tobias Holl in branch 
'master':
bpo-42924: Fix incorrect copy in bytearray_repeat (GH-24208)
https://github.com/python/cpython/commit/61d8c54f43a7871d016f98b38f86858817d927d5


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread tholl


Change by tholl :


--
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 1.0 -> 2.0
pull_requests: +23035
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/24208

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42924] bytearray_repeat copies from ob_bytes instead of ob_start

2021-01-13 Thread tholl


New submission from tholl :

`bytearray_repeat` uses `ob_bytes` rather than `ob_start` as its source data 
for copying, leading to incorrect results in some edge cases where the two are 
distinct. It should probably use `PyByteArray_AS_STRING(self)` just like 
`bytearray_irepeat` and basically all the other functions.

As far as I can see, these edge cases occur pretty much only after 
`bytearray_setslice_linear`, where `ob_start` can be adjusted without changing 
`ob_bytes`. 

A simple example (also attached as poc.py):

>>> ba = bytearray(b'0123456789abcdef')
>>> ba[:10] = b'test'
>>> print(ba)
bytearray(b'testabcdef')
>>> print(ba * 1)
bytearray(b'012345test')

I'll try to submit a PR for this later today.

--
components: Interpreter Core
files: poc.py
messages: 385017
nosy: tholl
priority: normal
severity: normal
status: open
title: bytearray_repeat copies from ob_bytes instead of ob_start
versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49739/poc.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com