[issue20783] bytearray init fails when \x00 is present

2014-02-26 Thread Andrew P. Lentvorski, Jr.

New submission from Andrew P. Lentvorski, Jr.:

The byte array init fails when \x00 is present

This fails:
ggRAM = bytearray(RAM_SIZE_BYTES, '\x00'*RAM_SIZE_BYTES)

However, this works:
ggRAM = bytearray(RAM_SIZE_BYTES)
ggRAM[:] = '\x00'*RAM_SIZE_BYTES

--
components: Interpreter Core
messages: 212281
nosy: bsder
priority: normal
severity: normal
status: open
title: bytearray init fails when \x00 is present
type: behavior
versions: Python 2.7

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



[issue20783] bytearray init fails when \x00 is present

2014-02-26 Thread R. David Murray

R. David Murray added the comment:

That isn't a valid bytearray initialization call.  The two argument form is 
(string, encoding), not (size, string).  The error message you get is a bit 
funky and not particularly informative, though.  Maybe someone will want to try 
to improve that.

--
nosy: +r.david.murray
stage:  - committed/rejected
versions: +Python 3.4, Python 3.5

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



[issue20783] bytearray init fails when \x00 is present

2014-02-26 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
stage: committed/rejected - 

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



[issue20783] bytearray init fails when \x00 is present

2014-02-26 Thread Andrew P. Lentvorski, Jr.

Andrew P. Lentvorski, Jr. added the comment:

Ayup, I are an idiot.  Sorry.

ggRAM = bytearray('\x00'*RAM_SIZE_BYTES)

Works fine.

--
status: open - closed

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



[issue20783] bytearray init fails when \x00 is present

2014-02-26 Thread Andrew P. Lentvorski, Jr.

Changes by Andrew P. Lentvorski, Jr. bs...@allcaps.org:


--
resolution:  - invalid

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