[issue20047] bytearray partition bug

2018-09-13 Thread Berker Peksag


Berker Peksag  added the comment:


New changeset 0b9fe1734168d45861d6dc3022492387dec5a4a2 by Berker Peksag 
(Zackery Spytz) in branch '2.7':
[2.7] bpo-20047: Remove Objects/bytesobject.c from 2.7 (GH-9268)
https://github.com/python/cpython/commit/0b9fe1734168d45861d6dc3022492387dec5a4a2


--
nosy: +berker.peksag

___
Python tracker 

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



[issue20047] bytearray partition bug

2018-09-13 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +8700

___
Python tracker 

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



[issue20047] bytearray partition bug

2017-10-29 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
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



[issue20047] bytearray partition bug

2017-10-29 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 107f3cc791d223dc06b7c80f0de672e88ae6a8d1 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-20047: Make bytearray methods partition() and rpartition() rejecting 
(GH-4158) (#4163)
https://github.com/python/cpython/commit/107f3cc791d223dc06b7c80f0de672e88ae6a8d1


--

___
Python tracker 

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



[issue20047] bytearray partition bug

2017-10-29 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 9ea5a3a45b35d01b602e7e4da4f72b2db407e5c6 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-20047: Make bytearray methods partition() and rpartition() rejecting 
(GH-4158) (#4162)
https://github.com/python/cpython/commit/9ea5a3a45b35d01b602e7e4da4f72b2db407e5c6


--

___
Python tracker 

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



[issue20047] bytearray partition bug

2017-10-29 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4132

___
Python tracker 

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



[issue20047] bytearray partition bug

2017-10-29 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4131

___
Python tracker 

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



[issue20047] bytearray partition bug

2017-10-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset a2314283ff87c65e1745a42c2f2b716b1a209128 by Serhiy Storchaka in 
branch 'master':
bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)
https://github.com/python/cpython/commit/a2314283ff87c65e1745a42c2f2b716b1a209128


--

___
Python tracker 

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



[issue20047] bytearray partition bug

2017-10-28 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

To answer Mark, even though no longer nosy: In general, sequence methods 
.count, .index, and .__contains__ take sequence members and only members as 
arguments.  Unicode sequences are exceptional because codepoints are not Python 
objects, so string subsequences must be used instead.  Byte-like sequences are 
also exceptional in that both members and subsequences are accepted for these 
methods.

String-like sequence methods .split and .partition take subsequences as 
arguments.  I think the doc should make this clearer.

--

___
Python tracker 

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



[issue20047] bytearray partition bug

2017-10-28 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4127
stage:  -> patch review

___
Python tracker 

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



[issue20047] bytearray partition bug

2017-10-28 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
versions: +Python 2.7, Python 3.6, Python 3.7 -Python 3.3, Python 3.4

___
Python tracker 

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



[issue20047] bytearray partition bug

2014-02-03 Thread Mark Lawrence

Changes by Mark Lawrence breamore...@yahoo.co.uk:


--
nosy:  -BreamoreBoy

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



[issue20047] bytearray partition bug

2013-12-30 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
nosy: +brett.cannon

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



[issue20047] bytearray partition bug

2013-12-21 Thread Mark Lawrence

New submission from Mark Lawrence:

If partition is called with a single byte it works correctly but if called with 
the equivalent integer it returns the same bytearray with two empty arrays as 
follows.

py ba = bytearray(range(8))
py ba
bytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07')
py 3 in ba
True
py ba.find(3) == ba.index(3) == ba.find(b'\x03')
True
py ba.partition(b'\x03')
(bytearray(b'\x00\x01\x02'), bytearray(b'\x03'), bytearray(b'\x04\x05\x06
\x07'))
py ba.partition(3)
(bytearray(b'\x00\x01\x02\x03\x04\x05\x06\x07'), bytearray(b''), bytearray
(b''))

More background on the thread starting here 
https://mail.python.org/pipermail/python-list/2013-December/663111.html which 
refers to Issue 12170.

--
components: Interpreter Core
messages: 206773
nosy: BreamoreBoy
priority: normal
severity: normal
status: open
title: bytearray partition bug
type: behavior
versions: Python 3.3

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



[issue20047] bytearray partition bug

2013-12-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Similar bug was in 3.2:

 ba = bytearray(range(8))
 ba[2:6]
bytearray(b'\x02\x03\x04\x05')
 ba[2:6] = 2
 ba
bytearray(b'\x00\x01\x00\x00\x06\x07')

Now it is fixed.

--
nosy: +serhiy.storchaka
versions: +Python 3.4

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



[issue20047] bytearray partition bug

2013-12-21 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Bytearray slice assignment bug was fixed in issue8401.

--
nosy: +ezio.melotti, georg.brandl, loewis, mark.dickinson, pitrou

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



[issue20047] bytearray partition bug

2013-12-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Whatever the change, bytes and bytearray should act the same.

 b = bytes(range(8))
 b
b'\x00\x01\x02\x03\x04\x05\x06\x07'
 b.partition(3)
Traceback (most recent call last):
  File pyshell#2, line 1, in module
b.partition(3)
TypeError: expected bytes, bytearray or buffer compatible object

As noted in the thread, ba.partition(a) apparently is executed as 
ba.partition(bytearray(a)) if a is not a bytearray (or maybe not a buffer 
object). bytearray(3) == bytearray((0,0,0)) and the latter is not in ba and 
hence the output given is 'correct'.

--
nosy: +terry.reedy

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



[issue20047] bytearray partition bug

2013-12-21 Thread Mark Lawrence

Mark Lawrence added the comment:

I believe that all methods should act the same, but they don't as a result of 
the work done in issue12170.  E.g. find will accept integer input but split 
will not.  Given this comment at the top of test_bytes.py XXX This is a mess.  
Common tests should be moved to buffer_tests.py, which itself ought to be 
unified with string_tests.py (and the latter should be modernized)., it looks 
like a thorough review of the code and tests is in order.

--

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