[issue1302] Fixes for profile/cprofile

2007-10-25 Thread Christian Heimes
Christian Heimes added the comment: Alexandre Vassalotti wrote: > It the address of lower[18] to be exact. (l < &lower[(sizeof lower) - > 2]) is simply tricky notation to check the bound of the array. > Personally, I used like to subtract pointer, ((lower - l + 1) < (sizeof > lower)) to get the b

[issue1302] Fixes for profile/cprofile

2007-10-25 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: > Personally, I used like to subtract pointer, ((lower - l + 1) < > (sizeof lower)) to get the bound. Doh. I got it backward. It's (l - lower + 1), not (lower - l + 1). > But now, I find Guido's trick more cute (and less error-prone). At least, I got th

[issue1302] Fixes for profile/cprofile

2007-10-25 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: > I still don't understand why you are using (sizeof lower) - 2 It is simply to avoid duplicating the constant (a.k.a. the Don't Repeat Yourself (DRY) rule). > and what &lower[(sizeof lower) - 2] returns. Is it the memory address > of lower[17]? It the

[issue1302] Fixes for profile/cprofile

2007-10-25 Thread Christian Heimes
Christian Heimes added the comment: Guido van Rossum wrote: > Guido van Rossum added the comment: > > Committed revision 58659. > > I'm sorry I confused you; I was fine with the version that has char > lower[N] but I wanted you to not repeat N-1 later in the code. See what > I checked in. :-)

[issue1302] Fixes for profile/cprofile

2007-10-25 Thread Guido van Rossum
Guido van Rossum added the comment: Committed revision 58659. I'm sorry I confused you; I was fine with the version that has char lower[N] but I wanted you to not repeat N-1 later in the code. See what I checked in. :-) -- resolution: -> accepted status: open -> closed ___

[issue1302] Fixes for profile/cprofile

2007-10-25 Thread Christian Heimes
Christian Heimes added the comment: Why should I use (sizeof(lower)-1)? Do you mean PyMem_Malloc(strlen(encoding) + 1)? Changes since last patch: * added #include "bytes_methods.h" in unicodeobject.c * fix all is* to use the macros from bytes_methods.h * use malloc/free the lower version instead

[issue1302] Fixes for profile/cprofile

2007-10-24 Thread Guido van Rossum
Guido van Rossum added the comment: I like Chris's patch better, but he should use (sizeof(lower)-1) instead of 8, and he should use the TOLOWER macro from bytes_methods.h. Please submit a new one and I'll check it in! -- priority: -> normal __ Tracker

[issue1302] Fixes for profile/cprofile

2007-10-21 Thread Christian Heimes
Christian Heimes added the comment: Alexandre Vassalotti wrote: > I don't think it's possible to add shortcuts in PyUnicode_Decode for > UTF-16 and UTF-32 because the byte-order can be different depending of > the platform. So, these two need to pass through the codecs module. utf-16 and utf-32

[issue1302] Fixes for profile/cprofile

2007-10-21 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: I don't think it's possible to add shortcuts in PyUnicode_Decode for UTF-16 and UTF-32 because the byte-order can be different depending of the platform. So, these two need to pass through the codecs module. I am sure if it's better, but I factored out the

[issue1302] Fixes for profile/cprofile

2007-10-20 Thread Christian Heimes
Christian Heimes added the comment: The new patch does a far more better job. I had the idea after a discussion with Alexandre on #python and a small debugging session. The tests for profile, cProfile and doctest are failing on my Linux box because Py_FileSystemDefaultEncoding is "UTF-8" but PyU

[issue1302] Fixes for profile/cprofile

2007-10-19 Thread Martin v. Löwis
Changes by Martin v. Löwis: -- keywords: +patch __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue1302] Fixes for profile/cprofile

2007-10-19 Thread Christian Heimes
Christian Heimes added the comment: Sure there is a patch ... well it's ... *uhm* ... it's hidden under your bed. O:-) Added file: http://bugs.python.org/file8569/py3k_profile_fix.patches __ Tracker <[EMAIL PROTECTED]> _

[issue1302] Fixes for profile/cprofile

2007-10-19 Thread Brett Cannon
Brett Cannon added the comment: There is no patch. =) -- assignee: -> gvanrossum keywords: +py3k nosy: +brett.cannon __ Tracker <[EMAIL PROTECTED]> __ ___

[issue1302] Fixes for profile/cprofile

2007-10-19 Thread Christian Heimes
New submission from Christian Heimes: The patch fixes the output for profile and cProfile. Another patch from Alexandre and me added additional calls to the UTF-8 codec. -- components: Library (Lib) messages: 56569 nosy: gvanrossum, tiran severity: normal status: open title: Fixes for pr