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

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 storch...@gmail.com 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

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 amaur...@gmail.com wrote: 2013/3/4 Serhiy Storchaka storch...@gmail.com 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

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 gu...@python.org 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

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 amaur...@gmail.com: 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

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 stefan.bu...@gmail.com 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.

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 stefan.bu...@gmail.com 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

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 stefan.bu...@gmail.com 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

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 ncogh...@gmail.com wrote: On Sat, Mar 2, 2013 at 1:24 AM, Stefan Bucur stefan.bu...@gmail.com 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

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 solip...@pitrou.net wrote: On Fri, 1 Mar 2013 16:24:42 +0100 Stefan Bucur stefan.bu...@gmail.com wrote: However, after applying this modification, when running make test I get a segfault in the test___all__ test case. Before digging deeper into

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 stefan.bu...@gmail.com On Sat, Mar 2, 2013 at 4:31 PM, Antoine Pitrou solip...@pitrou.net wrote: On Fri, 1 Mar 2013 16:24:42 +0100 Stefan Bucur stefan.bu...@gmail.com wrote:

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 stefan.bu...@gmail.com wrote: On Sat, Mar 2, 2013 at 4:31 PM, Antoine Pitrou solip...@pitrou.net wrote: On Fri, 1 Mar 2013 16:24:42 +0100 Stefan Bucur stefan.bu...@gmail.com wrote: However, after applying this modification, when running make