[issue3297] Python interpreter uses Unicode surrogate pairs only before the pyc is created

2008-07-05 Thread Ezio Melotti
New submission from Ezio Melotti <[EMAIL PROTECTED]>: Problem: when you have Unicode characters with a code point greater than U+ written directly in the source file (that is, not in the form u'\U' but as normal chars in a u'' string) the interpreter uses surrogate pairs for represent

[issue3290] python-config --cflags includes irrelevant flags

2008-07-05 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: Some flags for the compiler are really needed to compile the Python headers correctly, e.g. -fno-strict-aliasing in 2.6. So I think an explicit list of options reported would have to be maintained, either as a blacklist (e.g. -O, -Wall), or

[issue2620] Multiple buffer overflows in unicode processing

2008-07-05 Thread Gregory P. Smith
Gregory P. Smith <[EMAIL PROTECTED]> added the comment: here's an updated patch. It makes PyMem_NEW and PyMem_RESIZE macros always do explicit an overflow check before doing the multiplication. Uses of the the macros have been cleaned up in the couple places I noticed that would leak memory or

[issue3139] bytearrays are not thread safe

2008-07-05 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: Fixing this in the methods themselves has the disadvantage that the error reporting is not that good anymore. ___ Python tracker <[EMAIL PROTECTED]> _

[issue3290] python-config --cflags includes irrelevant flags

2008-07-05 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: I think you're right. However, Martin, what flags except -I can/must we keep? ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue3292] Position index limit; s.insert(i,x) not same as s[i:i]=[x]

2008-07-05 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Please bring it up on python-dev. ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-

[issue2620] Multiple buffer overflows in unicode processing

2008-07-05 Thread Gregory P. Smith
Changes by Gregory P. Smith <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10027/issue2620-gps01-patch.txt ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue2632] performance problem in socket._fileobject.read

2008-07-05 Thread Gregory P. Smith
Gregory P. Smith <[EMAIL PROTECTED]> added the comment: committed to release25-maint in r64754. -- resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> _

[issue2862] cleanup of freelist management

2008-07-05 Thread Gregory P. Smith
Gregory P. Smith <[EMAIL PROTECTED]> added the comment: committed to 2.6 trunk in r64753. -- resolution: -> accepted status: open -> closed ___ Python tracker <[EMAIL PROTECTED]>

[issue3296] print function not executed in python 3.0 tutorial

2008-07-05 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Thanks! Fixed in r64752. -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> __

[issue3295] PyExc_BufferError is declared but nowhere defined

2008-07-05 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Done in r64751. -- nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3296] print function not executed in python 3.0 tutorial

2008-07-05 Thread Florian Mayer
New submission from Florian Mayer <[EMAIL PROTECTED]>: It is for sure only a minor issue, but the new tutorial should not confuse readers as the print function is not executed here and does not do anything at all. Patch is attached. -- assignee: georg.brandl components: Documentation fil

[issue3294] SVN repository contains an incorrect symbolic link

2008-07-05 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Fixed in r64749. -- assignee: -> benjamin.peterson nosy: +benjamin.peterson resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]>

[issue3139] bytearrays are not thread safe

2008-07-05 Thread Antoine Pitrou
Changes by Antoine Pitrou <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file10823/bzcrash.patch ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue3139] bytearrays are not thread safe

2008-07-05 Thread Antoine Pitrou
Changes by Antoine Pitrou <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10822/bzcrash.py ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3139] bytearrays are not thread safe

2008-07-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: For reference, here is a proof-of-concept patch which shows how to fix the bytearray crasher above (it raises a BufferError instead). Added file: http://bugs.python.org/file10822/bzcrash.py ___ Python trac

[issue3295] PyExc_BufferError is declared but nowhere defined

2008-07-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: The following patch fixes it. -- keywords: +patch nosy: +teoliphant Added file: http://bugs.python.org/file10821/buffererror.patch ___ Python tracker <[EMAIL PROTECTED]>

[issue3139] bytearrays are not thread safe

2008-07-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Le samedi 05 juillet 2008 à 22:20 +, Martin v. Löwis a écrit : > Martin v. Löwis <[EMAIL PROTECTED]> added the comment: > > I believe the 2.6 s# processing works correctly; the error is in the > bytearray object. This either shouldn't sup

[issue3295] PyExc_BufferError is declared but nowhere defined

2008-07-05 Thread Antoine Pitrou
New submission from Antoine Pitrou <[EMAIL PROTECTED]>: Astonishingly, PyExc_BufferError is defined in pyerrors.h but it is defined nowhere. Consequently, any piece of code raising a PyExc_BufferError will cause the interpreter to crash as soon as it tries to do something with the exception... -

[issue3294] SVN repository contains an incorrect symbolic link

2008-07-05 Thread Antoine Pitrou
New submission from Antoine Pitrou <[EMAIL PROTECTED]>: In the py3k SVN branch I can see the following link. I suppose it is a mistake? $ ls -la Mac/IDLE/IDLE.app/Contents/MacOS/Python lrwxrwxrwx 1 antoine antoine 92 2008-07-01 22:33 Mac/IDLE/IDLE.app/Contents/MacOS/Python -> /Library/Frameworks

[issue3139] bytearrays are not thread safe

2008-07-05 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: I believe the 2.6 s# processing works correctly; the error is in the bytearray object. This either shouldn't support the buffer interface, or it shouldn't reallocate the buffer after having returned a pointer to it. For 3k, convertbuffer sho

[issue3293] incorrect comments for PyObject_ReleaseBuffer

2008-07-05 Thread Antoine Pitrou
New submission from Antoine Pitrou <[EMAIL PROTECTED]>: The declaration for PyObject_ReleaseBuffer (in Include/abstract.h) has the following comments attached to it. But the part about the return value is wrong since the function is defined as returning void. Also, PEP 3118 says it always succeed

[issue3292] Position index limit; s.insert(i,x) not same as s[i:i]=[x]

2008-07-05 Thread Terry J. Reedy
New submission from Terry J. Reedy <[EMAIL PROTECTED]>: Suggested changes to Lib Ref Manual: Sequence Types --...(3.6 for 2.5) (These are mostly based on an issue posted on c.l.p. The Plone Archetypes package (which I know nothing of) was reported as suggesting that users pass sys.maxint, to ind

[issue2834] re.IGNORECASE not Unicode-ready

2008-07-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: http://codereview.appspot.com/2439 ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bu

[issue3291] rlcompleter doesn't work anymore

2008-07-05 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Thanks for the report and the fix! (committed in r64748) -- resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3291] rlcompleter doesn't work anymore

2008-07-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Here is a fix (in addition to the one you already committed). -- keywords: +patch Added file: http://bugs.python.org/file10820/rlcompleter.patch ___ Python tracker <[EMAIL PROTECTED]>

[issue2834] re.IGNORECASE not Unicode-ready

2008-07-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: This new patch adds re.ASCII in all sensitive places I could find in the stdlib (except lib2to3 which as far as I understand is maintained in a separate branch, and even has its own copy of tokenize.py...). Also, I didn't get an answer to the

[issue3168] cmath test fails on Solaris 10

2008-07-05 Thread Jean Brouwers
Changes by Jean Brouwers <[EMAIL PROTECTED]>: Added file: http://bugs.python.org/file10818/config64.log.gz ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue3168] cmath test fails on Solaris 10

2008-07-05 Thread Jean Brouwers
Jean Brouwers <[EMAIL PROTECTED]> added the comment: Can't find that particular message. Attached is the entire log of one of the SUN C builds of Python 2.6b1. Added file: http://bugs.python.org/file10817/config.log.gz ___ Python tracker <[EMAIL PROTECTED]>

[issue3291] rlcompleter doesn't work anymore

2008-07-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Le samedi 05 juillet 2008 à 20:32 +, Benjamin Peterson a écrit : > Benjamin Peterson <[EMAIL PROTECTED]> added the comment: > > Antoine, can you try it before r64671? Bingo, the regression occurs exactly at r64671. _

[issue3239] curses/textpad.py incorrectly and redundantly imports ascii

2008-07-05 Thread Facundo Batista
Facundo Batista <[EMAIL PROTECTED]> added the comment: Commited in r64746. Thank you!! -- resolution: -> accepted status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3291] rlcompleter doesn't work anymore

2008-07-05 Thread Benjamin Peterson
Benjamin Peterson <[EMAIL PROTECTED]> added the comment: Antoine, can you try it before r64671? -- nosy: +benjamin.peterson ___ Python tracker <[EMAIL PROTECTED]> ___ _

[issue3291] rlcompleter doesn't work anymore

2008-07-05 Thread Antoine Pitrou
New submission from Antoine Pitrou <[EMAIL PROTECTED]>: In the latest py3k versions, rlcompleter doesn't work anymore. Pressing the tab key (with tab-completion enabled) doesn't produce anything on screen. -- components: Library (Lib) messages: 69293 nosy: pitrou severity: normal status:

[issue3290] python-config --cflags includes irrelevant flags

2008-07-05 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: Georg, what do you think? -- assignee: -> georg.brandl nosy: +georg.brandl, loewis ___ Python tracker <[EMAIL PROTECTED]> __

[issue3168] cmath test fails on Solaris 10

2008-07-05 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: > There is another, perhaps related issue on Solaris. The compiler warns > that function finite is implicitly defined. > > Commenting out this line in pyconfig.h as > > /* #define HAVE_FINITE 1 */ > > make that warning go away. If there is

[issue3289] unnecessary call to time and localtime slows time.mktime

2008-07-05 Thread Facundo Batista
Facundo Batista <[EMAIL PROTECTED]> added the comment: Commited in r64745. Thanks for this patch! -- nosy: +facundobatista resolution: -> accepted status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> __

[issue3290] python-config --cflags includes irrelevant flags

2008-07-05 Thread Sacha Varma
New submission from Sacha Varma <[EMAIL PROTECTED]>: As I understand it, python-config --cflags is intended to yield the C compiler flags needed to compile a program that uses Python headers and libraries (as opposed to the C flags needed to compile python itself). However, it seems to include i

[issue3139] bytearrays are not thread safe

2008-07-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Now I've just discovered there is the same problem with the array.array() type (see following code). import bz2, threading, array bz2c = bz2.BZ2Compressor() # Span at least a whole arena (256KB long) junk_len = 512 * 1024 junk = array.array

[issue3139] bytearrays are not thread safe

2008-07-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: By the way, here's a more reliable way to make it crash (on my Linux machine): import bz2, threading bz2c = bz2.BZ2Compressor() # Span at least a whole arena (256KB long) junk_len = 512 * 1024 junk = b"a" * junk_len buf = bytearray() for x

[issue3139] bytearrays are not thread safe

2008-07-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: If I try to follow the chain the consequences: - all PyArg_ParseTuple("s#") calls that release the GIL afterwards should be re-written to use another API (which one I don't know exactly, but hopefully the appropriate functions are already pro

[issue1023290] proposed struct module format code addition

2008-07-05 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Pickle is a solution only if you accept the target format to be opaque, which is not what you are looking for usually. Once again I just had to write the cumbersome: junk_len = 1024 junk = (("%%0%dX" % junk_len) % random.getrandbits(junk_len

[issue3235] Improve subprocess module usage

2008-07-05 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: I don't understand the comment about poll(). In any case, I plan on referencing Doug's PyMOTW pages for all modules he does, since they are indeed excellent tutorials. ___ Python tracker <[EMAIL PROTECTED]>

[issue3289] unnecessary call to time and localtime slows time.mktime

2008-07-05 Thread Jon Nelson
New submission from Jon Nelson <[EMAIL PROTECTED]>: Basically, time.mktime calls time and localtime, and then overwrites those results. Removing these unnecessary calls results in a fairly noticeable speedup, lower double-digit percentile improvements for applications that do time parsing, for ex

[issue3168] cmath test fails on Solaris 10

2008-07-05 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: Thanks, Jean. I've checked in your workaround in r64735. Leaving this open for now as a reminder about finite/is_finite. -- resolution: -> fixed ___ Python tracker <[EMAIL PROTECTED]>

[issue3188] float('infinity') should be valid

2008-07-05 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: Checked in, r64729. -- resolution: -> accepted status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

[issue3008] Let bin/oct/hex show floats

2008-07-05 Thread Mark Dickinson
Changes by Mark Dickinson <[EMAIL PROTECTED]>: Removed file: http://bugs.python.org/file10815/hex_float2.patch ___ Python tracker <[EMAIL PROTECTED]> ___ __

[issue3008] Let bin/oct/hex show floats

2008-07-05 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: Add updated patch with expanded documentation. Added file: http://bugs.python.org/file10816/hex_float2.patch ___ Python tracker <[EMAIL PROTECTED]> __

[issue1754483] linecache package handling

2008-07-05 Thread Hans Ulrich Niedermann
Hans Ulrich Niedermann <[EMAIL PROTECTED]> added the comment: Even with that patch, I'm still getting backtraces similar to this: Traceback (most recent call last): File "/home/user/foo/src/foo", line 83, in foomain(sys.argv) File "/home/uli/foo/src/foo", line 79, in foomain foolib.

[issue3008] Let bin/oct/hex show floats

2008-07-05 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: Here's an updated patch, complete with both float methods and documentation. Added file: http://bugs.python.org/file10815/hex_float2.patch ___ Python tracker <[EMAIL PROTECTED]>

[issue3288] float.as_integer_ratio method is not documented

2008-07-05 Thread Mark Dickinson
New submission from Mark Dickinson <[EMAIL PROTECTED]>: The float.as_integer_ratio method needs to be documented somewhere other than whatsnew/2.6.rst. -- assignee: georg.brandl components: Documentation messages: 69277 nosy: georg.brandl, marketdickinson severity: normal status: open t

[issue2663] shutil.copytree glob-style filtering [patch]

2008-07-05 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: Committed in r64722. Thanks everyone! -- resolution: -> fixed status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___

[issue1754483] linecache package handling

2008-07-05 Thread Georg Brandl
Changes by Georg Brandl <[EMAIL PROTECTED]>: -- assignee: -> georg.brandl nosy: +georg.brandl ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue3008] Let bin/oct/hex show floats

2008-07-05 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: > containing an implementation of from.fromhex and tests. That should be 'float.fromhex', not 'from.fromhex'. I should also have said that this patch is against the trunk; only minor changes should be required for py3k. ___

[issue3008] Let bin/oct/hex show floats

2008-07-05 Thread Mark Dickinson
Mark Dickinson <[EMAIL PROTECTED]> added the comment: In the interests of getting early feedback, here's half a patch, containing an implementation of from.fromhex and tests. Still to come: float.hex and documentation. I'll ask on python-dev about C99 and %a. Added file: http://bugs.python.o