[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: b9c8f1c80f47 added a new head. Should we merge 3.3 -> 3.4 -> 3.5 -> default? -- ___ Python tracker ___

[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-12 Thread Ned Deily
Changes by Ned Deily : -- stage: patch review -> resolved ___ Python tracker ___ ___

[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: serhiy.storchaka -> georg.brandl ___ Python tracker ___

[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I wait only Greg's approving for 3.3. If I'll not get it in a day, I'll > commit the patch for 3.4+. Maybe it was my fault. I made a mistake in Georg's name. -- ___ Python tracker

[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Georg Brandl
Georg Brandl added the comment: Backpicked to 3.3. Sorry for the wait. -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset b9c8f1c80f47 by Serhiy Storchaka in branch '3.3': Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache. https://hg.python.org/cpython/rev/b9c8f1c80f47 -- ___ Python tracker

[issue25709] Problem with string concatenation and utf-8 cache.

2016-02-11 Thread Georg Brandl
Georg Brandl added the comment: Actually I prefer Greg to Gerg, so it's only half bad. :D -- ___ Python tracker ___

[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-06 Thread Roundup Robot
Roundup Robot added the comment: New changeset 376b100107ba by Serhiy Storchaka in branch '3.5': Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache. https://hg.python.org/cpython/rev/376b100107ba -- ___ Python tracker

[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-05 Thread Larry Hastings
Larry Hastings added the comment: I cherry-picked this for 3.5.1. -- ___ Python tracker ___ ___

[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-03 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- versions: -Python 3.4, Python 3.5, Python 3.6 ___ Python tracker ___

[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 67718032badb by Serhiy Storchaka in branch '3.4': Issue #25709: Fixed problem with in-place string concatenation and utf-8 cache. https://hg.python.org/cpython/rev/67718032badb New changeset a0e2376768dc by Serhiy Storchaka in branch '3.5': Issue

[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-02 Thread STINNER Victor
STINNER Victor added the comment: > New changeset 67718032badb by Serhiy Storchaka in branch '3.4': Thanks. -- ___ Python tracker ___

[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-02 Thread Larry Hastings
Larry Hastings added the comment: Is this going in soon? I want to cherry-pick this for 3.5.1, which I tag in about 80 hours. -- ___ Python tracker ___

[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I wait only Greg's approving for 3.3. If I'll not get it in a day, I'll commit the patch for 3.4+. -- ___ Python tracker

[issue25709] Problem with string concatenation and utf-8 cache.

2015-12-02 Thread STINNER Victor
STINNER Victor added the comment: Please commit right now to 3.4+. Backport to 3.3 can be done later. -- ___ Python tracker ___

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fixed yet one bug (thanks Victor again). Test is improved, now it doesn't rely on implementation detail of particular builtin. -- Added file: http://bugs.python.org/file41146/issue25709_4.patch ___ Python tracker

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 24.11.2015 02:30, Steven D'Aprano wrote: > > Steven D'Aprano added the comment: > > On Mon, Nov 23, 2015 at 09:48:46PM +, STINNER Victor wrote: > >> * the string has a cached UTF-8 byte string (ex: int(s) was called before >> the resize) > > Why

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Why do strings cache their UTF-8 encoding? Mainly for compatibility with existing C API. Common way to parse function arguments in implemented in C function is to use special argument parsing API: PyArg_ParseTuple, PyArg_ParseTupleAndKeywords, or

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-24 Thread STINNER Victor
STINNER Victor added the comment: issue25709_4.patch now looks good to me, but I added some minor comments on the review. -- ___ Python tracker ___

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Georg, I ask for applying this fix to 3.3. -- nosy: +georg.brandl versions: +Python 3.3 ___ Python tracker ___

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: It would be good to get this in 3.4.4. -- components: +Library (Lib) -IDLE nosy: +benjamin.peterson, ezio.melotti, haypo, lemburg, pitrou -kbk, roger.serwy title: greek alphabet bug it is very disturbing... -> Problem with string concatenation and

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Added test without using pickle. -- nosy: +larry priority: high -> release blocker Added file: http://bugs.python.org/file41141/issue25709_2.patch ___ Python tracker

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Eryk Sun
Eryk Sun added the comment: Serhiy, when does sharing UTF-8 data occur in a compact object? It has to be ASCII since non-ASCII UTF-8 isn't sharable, but PyASCIIObject doesn't have the utf8 field. So it has to be a PyCompactUnicodeObject. But isn't ASCII always allocated as a PyASCIIObject? I

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In updated patch fixed a bug found by Victor and addressed other his comments. Many thanks Victor! -- Added file: http://bugs.python.org/file41142/issue25709_3.patch ___ Python tracker

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Mon, Nov 23, 2015 at 09:48:46PM +, STINNER Victor wrote: > * the string has a cached UTF-8 byte string (ex: int(s) was called before the > resize) Why do strings cache their UTF-8 encoding? I presume that some of Python's internals rely on the UTF-8

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread STINNER Victor
STINNER Victor added the comment: Steven D'Aprano added the comment: > the problem with caches is that you run the risk of the cache being out of date. Since strings are immutable, it's not a big deal. We control where strings are modified (unicodeobject.c). --

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Eryk Sun
Eryk Sun added the comment: > Why do strings cache their UTF-8 encoding? Strings also cache the wide-string representation. For example: from ctypes import * s = '\241\242\243' pythonapi.PyUnicode_AsUnicodeAndSize(py_object(s), None)

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread STINNER Victor
STINNER Victor added the comment: I reviewed issue25709_2.patch. > It would be good to get this in 3.4.4. Since it's a major bug in the Unicode implementation, it may be worth to fix it in Python 3.3. The bug was introduced in Python 3.3 by the PEP 393. --

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: 3.3 is presumably in security mode. Anyone using it would have had to live with the bug for a long time already. -- ___ Python tracker

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread random832
random832 added the comment: > unicode_modifiable in Objects/unicodeobject.c should return 0 if there's > cached PyUnicode_UTF8 data. In this case PyUnicode_Append won't operate in > place but instead concatenate a new string. Shouldn't it still operate in place but clear it? Operating in

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread Larry Hastings
Larry Hastings added the comment: I read some comments here and on the patches. Serhiy's patch adds some code and Victor says you can't call that macro on this object and wow this is badly broken. Can someone explain in simpler terms what's so broken, exactly? --

[issue25709] Problem with string concatenation and utf-8 cache.

2015-11-23 Thread STINNER Victor
STINNER Victor added the comment: " and wow this is badly broken " I mean the currently code is badly broken. The bug is that sometimes, when a string is resized (which doesn't make sense, strings are immutable, right? :-D), the cached UTF-8 string can become corrupted (old pointer not

Python solve problem with string operation

2014-01-16 Thread Nac Temha
Hi everyone, I want to do operation with chars in the given string. Actually I want to grouping the same chars. For example; input : 3443331123377 operation- (3)(44)()(333)(11)(2)(33)(77) output: 34131237 How can I do without list, regular expression. just using string

Re: Python solve problem with string operation

2014-01-16 Thread John Gordon
In mailman.5607.1389911083.18130.python-l...@python.org Nac Temha nacctte...@gmail.com writes: --047d7b6d95d0367a3d04f01de490 Content-Type: text/plain; charset=ISO-8859-1 Hi everyone, I want to do operation with chars in the given string. Actually I want to grouping the same chars. For

Re: Python solve problem with string operation

2014-01-16 Thread Tim Chase
On 2014-01-17 00:24, Nac Temha wrote: Hi everyone, I want to do operation with chars in the given string. Actually I want to grouping the same chars. For example; input : 3443331123377 operation- (3)(44)()(333)(11)(2)(33)(77) output: 34131237 How can I do without

Re: Python solve problem with string operation

2014-01-16 Thread Mark Lawrence
On 16/01/2014 22:30, John Gordon wrote: In mailman.5607.1389911083.18130.python-l...@python.org Nac Temha nacctte...@gmail.com writes: --047d7b6d95d0367a3d04f01de490 Content-Type: text/plain; charset=ISO-8859-1 Hi everyone, I want to do operation with chars in the given string. Actually

Re: Python solve problem with string operation

2014-01-16 Thread John Gordon
In mailman.5609.1389912537.18130.python-l...@python.org Mark Lawrence breamore...@yahoo.co.uk writes: input = 3443331123377 output = [] previous_ch = None for ch in input: if ch != previous_ch: output.append(ch) previous_ch = ch print

Re: Python solve problem with string operation

2014-01-16 Thread giacomo boffi
Nac Temha nacctte...@gmail.com writes: Hi everyone, I want to do operation with chars in the given string. Actually I want to grouping the same chars. For example; input : 3443331123377 operation- (3)(44)()(333)(11)(2)(33)(77) output: 34131237 How can I do without

Re: Python solve problem with string operation

2014-01-16 Thread Denis McMahon
On Fri, 17 Jan 2014 00:24:40 +0200, Nac Temha wrote: Hi everyone, I want to do operation with chars in the given string. Actually I want to grouping the same chars. For example; input : 3443331123377 operation- (3)(44)()(333)(11)(2)(33)(77) output: 34131237 How can

Re: Python solve problem with string operation

2014-01-16 Thread giacomo boffi
giacomo boffi pec...@pascolo.net writes: % python a.py 34131237 % cat a.py i=3443331123377;n=0 while n+1!=len(i):i,n=(i[:n]+i[n+1:],n) if i[n+1]==i[n] else (i,n+1) print i % python a.py 34131237 % -- for Nikos -- https://mail.python.org/mailman/listinfo/python-list

Re: Python solve problem with string operation

2014-01-16 Thread Rhodri James
On Thu, 16 Jan 2014 22:24:40 -, Nac Temha nacctte...@gmail.com wrote: Hi everyone, I want to do operation with chars in the given string. Actually I want to grouping the same chars. For example; input : 3443331123377 operation- (3)(44)()(333)(11)(2)(33)(77) output:

Re: Python solve problem with string operation

2014-01-16 Thread Asaf Las
inpu = 3443331123377 tstr = inpu[0] for k in range(1, len(inpu)): if inpu[k] != inpu[k-1] : tstr = tstr + inpu[k] print(tstr) -- https://mail.python.org/mailman/listinfo/python-list

a interesting Parallel Programing Problem: asciify-string

2012-03-06 Thread Xah Lee
here's a interesting problem that we are discussing at comp.lang.lisp. 〈Parallel Programing Problem: asciify-string〉 http://xahlee.org/comp/parallel_programing_exercise_asciify-string.html here's the plain text. Code example is emacs lisp, but the problem is general. for a bit python relevancy

Re: Problem with string format

2009-03-11 Thread Terry Reedy
Mike314 wrote: Hello, I have a strange problem with the string format: '%s %s %s %s %s' % ['01', '02', '03', '04', '05'] Traceback (most recent call last): File stdin, line 1, in module TypeError: not enough arguments for format string But as soon I use tuple it is working: '%s %s %s

Problem with string format

2009-03-10 Thread Mike314
Hello, I have a strange problem with the string format: '%s %s %s %s %s' % ['01', '02', '03', '04', '05'] Traceback (most recent call last): File stdin, line 1, in module TypeError: not enough arguments for format string But as soon I use tuple it is working: '%s %s %s %s %s' % ('01

Re: Problem with string format

2009-03-10 Thread Steven D'Aprano
On Tue, 10 Mar 2009 22:07:59 -0700, Mike314 wrote: Hello, I have a strange problem with the string format: '%s %s %s %s %s' % ['01', '02', '03', '04', '05'] Traceback (most recent call last): File stdin, line 1, in module TypeError: not enough arguments for format string

Re: Problem with string format

2009-03-10 Thread Mensanator
On Mar 11, 12:07 am, Mike314 michae...@gmail.com wrote: Hello,    I have a strange problem with the string format: '%s %s %s %s %s' % ['01', '02', '03', '04', '05'] Traceback (most recent call last):   File stdin, line 1, in module TypeError: not enough arguments for format string

Re: Problem with string format

2009-03-10 Thread John Machin
On Mar 11, 4:07 pm, Mike314 michae...@gmail.com wrote: Hello,    I have a strange problem with the string format: '%s %s %s %s %s' % ['01', '02', '03', '04', '05'] Traceback (most recent call last):   File stdin, line 1, in module TypeError: not enough arguments for format string

Re: Problem with string - int conversion ?

2005-08-31 Thread Madhusudan Singh
Fredrik Lundh wrote: The code is : void Form3::getNPrange() { what language is this? Its python embedded in the designer workflow. pyuic extracts stuff from it, and generates a python script from the ui.h file. if the callback code is Python, you should be able to add a print

Re: Problem with string - int conversion ?

2005-08-31 Thread Fredrik Lundh
Madhusudan Singh wrote: if the callback code is Python, you should be able to add a print statement to the line just before the failing int call: print repr(signalrangestr), type(signalrangestr) signalrange = int(signalrangestr) that print statement should be all you need to figure

Problem with string - int conversion ?

2005-08-30 Thread Madhusudan Singh
Hi I am working with an application that I designed with the Designer pyuic workflow and I get the following error on trying to process the contents of a combobox : Traceback (most recent call last): File measure.py, line 908, in acquiredata np=self.getNPrange() File measure.py, line

Re: Problem with string - int conversion ?

2005-08-30 Thread Fredrik Lundh
Madhusudan Singh wrote: I am working with an application that I designed with the Designer pyuic workflow and I get the following error on trying to process the contents of a combobox : Traceback (most recent call last): File measure.py, line 908, in acquiredata np=self.getNPrange()

problem with string

2005-07-22 Thread Tzanko Tzanev
hi :) I need some help for this script I have cursor = conn.cursor() cursor.execute(select * from playlist limit 5) result = cursor.fetchall() # iterate through resultset playlist_txt = '' for record in result: mp3id = record[0] mp3_title = record[1] mp3_artist = record[2]

Re: problem with string

2005-07-22 Thread John Machin
Tzanko Tzanev wrote: hi :) I need some help for this script I have cursor = conn.cursor() cursor.execute(select * from playlist limit 5) result = cursor.fetchall() # iterate through resultset playlist_txt = '' for record in result: mp3id = record[0] mp3_title =

Re: problem with string

2005-07-22 Thread Bruno Desthuilliers
Tzanko Tzanev a écrit : hi :) I need some help for this script I have please take care of indentation when posting code. cursor = conn.cursor() cursor.execute(select * from playlist limit 5) result = cursor.fetchall() # iterate through resultset playlist_txt = ''

Re: problem with string

2005-07-22 Thread Michael Hoffman
Tzanko Tzanev wrote: #but there is an error in playlist_txt += mp3id + mp3_title + mp3_artist It'd be a lot easier to help if you'd say what the error was. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list