Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-04-14 Thread Martin v. Löwis
Neal Norwitz wrote: I'll leave this decision to Martin or someone else, since I'm not familiar with the ramifications. Since it was documented as unsigned, I think it's reasonable to consider changing. Though it could create signed-ness warnings in other modules. I'm not sure but it's

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-04-14 Thread M.-A. Lemburg
Martin v. Löwis wrote: Neal Norwitz wrote: I'll leave this decision to Martin or someone else, since I'm not familiar with the ramifications. Since it was documented as unsigned, I think it's reasonable to consider changing. Though it could create signed-ness warnings in other modules. I'm

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-04-14 Thread Martin v. Löwis
M.-A. Lemburg wrote: I'd argue that such code is broken anyway: 3rd party code simply cannot make any assumptions on the typedef behind Py_UNICODE. The code would work just fine now, but will stop working with the change. Users of the code might not be open to arguments. In any case, it's up

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-04-14 Thread M.-A. Lemburg
Martin v. Löwis wrote: M.-A. Lemburg wrote: I'd argue that such code is broken anyway: 3rd party code simply cannot make any assumptions on the typedef behind Py_UNICODE. The code would work just fine now, but will stop working with the change. Users of the code might not be open to

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-04-13 Thread M.-A. Lemburg
Neal Norwitz wrote: On 3/31/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: Martin v. Löwis wrote: Neal Norwitz wrote: See http://python.org/sf/1454485 for the gory details. Basically if you create a unicode array (array.array('u')) and try to append an 8-bit string (ie, not unicode), you can

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-04-13 Thread Neal Norwitz
On 4/13/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: Does this mean you would like to see this patch checked in to 2.5? Yes. Ok, I checked this in to 2.5 (minus the syntax error). I also think that changing the type from signed to unsigned by backporting the configure fix will only make

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-04-12 Thread Neal Norwitz
On 3/31/06, M.-A. Lemburg [EMAIL PROTECTED] wrote: Martin v. Löwis wrote: Neal Norwitz wrote: See http://python.org/sf/1454485 for the gory details. Basically if you create a unicode array (array.array('u')) and try to append an 8-bit string (ie, not unicode), you can crash the

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-03-31 Thread M.-A. Lemburg
Martin v. Löwis wrote: Neal Norwitz wrote: See http://python.org/sf/1454485 for the gory details. Basically if you create a unicode array (array.array('u')) and try to append an 8-bit string (ie, not unicode), you can crash the interpreter. The problem is that the string is converted

Re: [Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-03-30 Thread Martin v. Löwis
Neal Norwitz wrote: See http://python.org/sf/1454485 for the gory details. Basically if you create a unicode array (array.array('u')) and try to append an 8-bit string (ie, not unicode), you can crash the interpreter. The problem is that the string is converted without question to a

[Python-Dev] unicode vs buffer (array) design issue can crash interpreter

2006-03-29 Thread Neal Norwitz
See http://python.org/sf/1454485 for the gory details. Basically if you create a unicode array (array.array('u')) and try to append an 8-bit string (ie, not unicode), you can crash the interpreter. The problem is that the string is converted without question to a unicode buffer. Within unicode,