Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-04 Thread Victor Stinner
Hi, 2013/3/4 Amaury Forgeot d'Arc : > The example above is obviously from python2.7; there is a similar example > with python3.2: x = b'\xe9\xe9'.decode('ascii', 'ignore') x == '', x is '' > (True, False) > > ...but this bug has been fixed in 3.3: PyUnicode_Resize() always returns the >

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-04 Thread Amaury Forgeot d'Arc
2013/3/4 Guido van Rossum > x = u'\xe9'.encode('ascii', 'ignore') > x == '', x is '' > > (True, False) > > Code that relies on this is incorrect (the language doesn't guarantee > interning) but nevertheless given the intention of the implementation, > that behavior of encode() is also a

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-04 Thread Guido van Rossum
On Mon, Mar 4, 2013 at 11:06 AM, Amaury Forgeot d'Arc wrote: > > > 2013/3/4 Serhiy Storchaka >> >> On 01.03.13 17:24, Stefan Bucur wrote: >>> >>> Before digging deeper into the issue, I wanted to ask here if there are >>> any implicit assumptions about string identity and interning throughout >>>

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-04 Thread Amaury Forgeot d'Arc
2013/3/4 Serhiy Storchaka > On 01.03.13 17:24, Stefan Bucur wrote: > >> Before digging deeper into the issue, I wanted to ask here if there are >> any implicit assumptions about string identity and interning throughout >> the interpreter implementation. For instance, are two single-char >> string

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-04 Thread Serhiy Storchaka
On 01.03.13 17:24, Stefan Bucur wrote: Before digging deeper into the issue, I wanted to ask here if there are any implicit assumptions about string identity and interning throughout the interpreter implementation. For instance, are two single-char strings having the same content supposed to be i

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-04 Thread Serhiy Storchaka
On 02.03.13 22:32, Terry Reedy wrote: I am just curious: does 3.3 still intern (some) unicode chars? Did the 256 interned bytes of 2.x carry over to 3.x? Yes, Python 3 interns an empty string and first 256 Unicode characters. ___ Python-Dev mailing

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-02 Thread Antoine Pitrou
On Sat, 2 Mar 2013 22:13:56 +0100 Stefan Bucur wrote: > On Sat, Mar 2, 2013 at 4:31 PM, Antoine Pitrou wrote: > > On Fri, 1 Mar 2013 16:24:42 +0100 > > Stefan Bucur wrote: > >> > >> However, after applying this modification, when running "make test" I get a > >> segfault in the test___all__ tes

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-02 Thread Lukas Lueg
Debugging a refcount bug? Good. Out of the door, line on the left, one cross each. 2013/3/2 Stefan Bucur > On Sat, Mar 2, 2013 at 4:31 PM, Antoine Pitrou > wrote: > > On Fri, 1 Mar 2013 16:24:42 +0100 > > Stefan Bucur wrote: > >> > >> However, after applying this modification, when running "m

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-02 Thread Stefan Bucur
On Sat, Mar 2, 2013 at 4:31 PM, Antoine Pitrou wrote: > On Fri, 1 Mar 2013 16:24:42 +0100 > Stefan Bucur wrote: >> >> However, after applying this modification, when running "make test" I get a >> segfault in the test___all__ test case. >> >> Before digging deeper into the issue, I wanted to ask

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-02 Thread Stefan Bucur
On Sat, Mar 2, 2013 at 4:08 PM, Nick Coghlan wrote: > On Sat, Mar 2, 2013 at 1:24 AM, Stefan Bucur wrote: >> Hi, >> >> I'm working on an automated bug finding tool that I'm trying to apply on the >> Python interpreter code (version 2.7.3). Because of early prototype >> limitations, I needed to di

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-02 Thread Terry Reedy
On 3/2/2013 10:08 AM, Nick Coghlan wrote: On Sat, Mar 2, 2013 at 1:24 AM, Stefan Bucur wrote: Hi, I'm working on an automated bug finding tool that I'm trying to apply on the Python interpreter code (version 2.7.3). Because of early prototype limitations, I needed to disable string interning i

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-02 Thread Antoine Pitrou
On Fri, 1 Mar 2013 16:24:42 +0100 Stefan Bucur wrote: > > However, after applying this modification, when running "make test" I get a > segfault in the test___all__ test case. > > Before digging deeper into the issue, I wanted to ask here if there are any > implicit assumptions about string iden

Re: [Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-02 Thread Nick Coghlan
On Sat, Mar 2, 2013 at 1:24 AM, Stefan Bucur wrote: > Hi, > > I'm working on an automated bug finding tool that I'm trying to apply on the > Python interpreter code (version 2.7.3). Because of early prototype > limitations, I needed to disable string interning in stringobject.c. More > precisely,

[Python-Dev] Disabling string interning for null and single-char causes segfaults

2013-03-01 Thread Stefan Bucur
Hi, I'm working on an automated bug finding tool that I'm trying to apply on the Python interpreter code (version 2.7.3). Because of early prototype limitations, I needed to disable string interning in stringobject.c. More precisely, I modified the PyString_FromStringAndSize and PyString_FromStrin