[issue1943] improved allocation of PyUnicode objects

2008-01-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Your microbenchmark is biased towards your patched version. The KEEPALIVE_SIZE_LIMIT will only cut in when you deallocate and then reallocate Unicode objects. The free list used for Unicode objects is also limited to 1024 objects - which isn't all that much.

[issue1944] Documentation for PyUnicode_AsString (et al.) missing.

2008-01-27 Thread Christian Heimes
Changes by Christian Heimes: -- priority: -> normal type: -> rfe __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscr

[issue1945] Document back ported C functions

2008-01-27 Thread Christian Heimes
New submission from Christian Heimes: Document the C functions which were back ported from py3k in r60283. -- components: Documentation keywords: easy messages: 61736 nosy: tiran priority: normal severity: normal status: open title: Document back ported C functions type: rfe versions: Py

[issue1682] Move Demo/classes/Rat.py to Lib/rational.py and fix it up.

2008-01-27 Thread Mark Dickinson
Mark Dickinson added the comment: I noticed that the ability to type Rational("2.3") has been added (and I think this is a very useful addition). One minor nit: would it make sense to have Rational("2.") and Rational(".3") also work? These strings work for float() and Decimal(), and 2. and

[issue1943] improved allocation of PyUnicode objects

2008-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: With KEEPALIVE_SIZE_LIMIT = 200, the pybench runtime is basically the same as with my patched version. stringbench remains a bit faster though (~8%). You say that RAM size is cheaper than CPU power today, which is true but misses one part of the picture: the imp

[issue1946] re.search hangs on this

2008-01-27 Thread Israel Tsadok
New submission from Israel Tsadok: import re re.search(r'a(b[^b]*b|[^c])*cxxx', 'abbcacacabbcabbcacabbcacac') perl seems to handle this just fine. (The original problem was trying to translate some html to text: re.sub(r'])*>(.*?)', r'\1\n') This hanged on s

[issue1943] improved allocation of PyUnicode objects

2008-01-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: I don't really see the connection with #1629305. An optimization that would be worth checking is hooking up the Py_UNICODE pointer to interned Unicode objects if the contents match (e.g. do a quick check based on the hash value and then a memcmp). That woul

[issue1943] improved allocation of PyUnicode objects

2008-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: All of those proposals are much heavier to implement; they also make the unicode type more complicated and difficult to maintain probably (while turning it into a PyVarObject actually shortens the implementation a bit). In any case, it's not something I want to t

[issue1947] Exception exceptions.AttributeError '_shutdown' in

2008-01-27 Thread shore.cloud
New submission from shore.cloud: Exception exceptions.AttributeError: '_shutdown' in ignored -- files: thread1.py messages: 61742 nosy: Mr Shore severity: normal status: open title: Exception exceptions.AttributeError '_shutdown' in http://bugs.python.org/file9299/thread1.py _

[issue1943] improved allocation of PyUnicode objects

2008-01-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Agreed, those optimizations do make the implementation more complicated. It's also not clear whether they would really be worth it. #1629305 only provided speedups for the case where you write s += 'abc'. The usual idiom for this is to use a list and then co

[issue1867] patch for pydoc to work in py3k

2008-01-27 Thread Georg Brandl
Georg Brandl added the comment: Done in r60366, thanks! __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue1941] 2.6 stdlib using with statement

2008-01-27 Thread Benjamin Peterson
Benjamin Peterson added the comment: Today, I carefully looked through every change in my patching. I asked myself "Does this do the same things in the same order as the original?" and "Could exceptions cause the code to function differently?" They only changes were when the block which used the

[issue1947] Exception exceptions.AttributeError '_shutdown' in

2008-01-27 Thread Christian Heimes
Christian Heimes added the comment: Next time please set type, component and version -- components: +Library (Lib) nosy: +tiran priority: -> low type: -> behavior versions: +Python 2.5 __ Tracker <[EMAIL PROTECTED]> __

[issue1943] improved allocation of PyUnicode objects

2008-01-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: I know it's not the place to discuss #1629305, but the join() solution is not always faster. Why? Because 1) there's the list contruction and method call overhead 2) ceval.c has some bytecode hackery to try and make plain concatenations somewhat less slow. As fo

[issue1948] Cant open python gui using VISTA

2008-01-27 Thread safe alattar
New submission from safe alattar: I need help opening the python gui (IDLE). On XP I had no issues. On Vista nothing occurs when I try to open IDLE. If there is a solution to this, please let me know in a user friendly manner (Im new to this!) Thanks. -- messages: 61749 nosy: needhelpasa

[issue1947] Exception exceptions.AttributeError '_shutdown' in

2008-01-27 Thread shore.cloud
shore.cloud added the comment: I will,sorry 2008/1/28, Christian Heimes <[EMAIL PROTECTED]>: > > > Christian Heimes added the comment: > > Next time please set type, component and version > > -- > components: +Library (Lib) > nosy: +tiran > priority: -> low > type: -> behavior > versio

[issue1949] test_ntpath.py rewriting

2008-01-27 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola': Since I noticed that test_ntpath.py (unlike test_genericpath.py, test_macpath.py and test_posixpath.py) does NOT use unittest for doing tests I tried to rewrite it. The patch in attachment does that leaving the original tests unchanged. Tested successfully

[issue1949] test_ntpath.py rewriting

2008-01-27 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola': Added file: http://bugs.python.org/file9302/test_ntpath.py __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing

[issue1949] test_ntpath.py converted to unittest

2008-01-27 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola': -- title: test_ntpath.py rewriting -> test_ntpath.py converted to unittest __ Tracker <[EMAIL PROTECTED]> __ ___ P

[issue1948] Cant open python gui using VISTA

2008-01-27 Thread Christian Heimes
Christian Heimes added the comment: I assume you are talking about Python 2.5.1 on Windows Vista? Yes, there is a solution. You have to unhide the folder .idlerc in your USERPROFILE directory and remove its content. -- assignee: -> kbk components: +IDLE nosy: +kbk, tiran priority: -> h

[issue1949] test_ntpath.py rewriting

2008-01-27 Thread Christian Heimes
Christian Heimes added the comment: The patch looks fine but I've no time to review it properly. -- keywords: +easy, patch nosy: +tiran priority: -> normal resolution: -> accepted type: -> rfe __ Tracker <[EMAIL PROTECTED]>

[issue1950] Potential Overflow due to incorrect usage of PyUnicode_AsString.

2008-01-27 Thread Alexandre Vassalotti
New submission from Alexandre Vassalotti: I have found a few instances of the following pattern in Py3k: char buf[MAX]; len = PyUnicode_GET_SIZE(str); if (len >= MAX) /* return error */ strcpy(buf, PyUnicode_AsString(str)); which could overflow if str contains non-ASCII char

[issue1950] Potential overflows due to incorrect usage of PyUnicode_AsString.

2008-01-27 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti: -- title: Potential Overflow due to incorrect usage of PyUnicode_AsString. -> Potential overflows due to incorrect usage of PyUnicode_AsString. __ Tracker <[EMAIL PROTECTED]> ___

[issue1951] test_wave.py converted to unittest

2008-01-27 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola': In attachment. -- components: Tests files: test_wave.diff messages: 61754 nosy: giampaolo.rodola severity: minor status: open title: test_wave.py converted to unittest type: rfe versions: Python 2.6 Added file: http://bugs.python.org/file9304/test_w

[issue1951] test_wave.py converted to unittest

2008-01-27 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Sorry but I realized right now by reading Lib/test/readme.txt that the test scripts are required to have a global "test_main()" function defined hence the "main()" function I defined in my patch should be renamed in "test_main()".

[issue1952] test_select.py converted to unittest

2008-01-27 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola': In attachment. -- components: Tests files: test_select.diff messages: 61756 nosy: giampaolo.rodola severity: minor status: open title: test_select.py converted to unittest type: rfe versions: Python 2.6 Added file: http://bugs.python.org/file9305/te

[issue1952] test_select.py converted to unittest

2008-01-27 Thread Giampaolo Rodola'
Changes by Giampaolo Rodola': Added file: http://bugs.python.org/file9306/test_select.py __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Neal Norwitz
Neal Norwitz added the comment: I'm just starting to look at the patch. The first one changes i to unsigned in Modules/_csv.c. Hopefully most of them are like this. The code is fine as it is. There is no reliance on overflow AFAICT. It's just that the breaking condition from the loop is not

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Ismail Donmez
Ismail Donmez added the comment: Thanks for the through review! I will add -Wsign-compare and fix new warnings. Btw current state is with the patch -fwrapv is not needed and no regressions. __ Tracker <[EMAIL PROTECTED]>

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Neal Norwitz
Neal Norwitz added the comment: I just added -Wstrict-overflow to the code in sysmodule.c (sys_getframe) and tried with gcc 4.2.1. It doesn't warn. I wonder if 4.3 is more picky or warns when it shouldn't? Unless if I changed the code so it doesn't work: typedef struct {int ref;} PyObject; ty

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Guido van Rossum
Guido van Rossum added the comment: Unfortunately I have no time to work on this myself, but in order to make progress I recommend checking in things piecemeal so that the same changes don't get reviewed over and over again. I propose that each submit reference this bug ("Partial fix for issue #

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Ismail Donmez
Ismail Donmez added the comment: To Neal, Can you try with -Wstrict-overflow=3 , but yes I am using gcc 4.3 trunk. To Guido, I'll check _csv.c issue closely. Shall I create the new bug reports or will reviewers will do so and CC me maybe? __ Tracker <[EMAIL PRO

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Neal Norwitz
Neal Norwitz added the comment: On Jan 27, 2008 6:45 PM, Ismail Donmez <[EMAIL PROTECTED]> wrote: > > Can you try with -Wstrict-overflow=3 , but yes I am using gcc 4.3 trunk. I just tried with =1, =2, =3, and no =. All the same result: no warning. Ismail, thanks for going through all this eff

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Guido van Rossum
Guido van Rossum added the comment: Don't create new bug reports! __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Ismail Donmez
Ismail Donmez added the comment: Neal, I'll try to answer your questions one by one, first with _csv.c compiler issues : Modules/_csv.c:969: warning: assuming signed overflow does not occur when simplifying conditional to constant There is a check inside loop like this: if (c =

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Ismail Donmez
Ismail Donmez added the comment: _sre.c case is the most interesting one , compiler says : ./Modules/_sre.c:1002: warning: assuming signed overflow does not occur when simplifying conditional to constant ./Modules/_sre.c:1069: warning: assuming signed overflow does not occur when simplifying con

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Ismail Donmez
Ismail Donmez added the comment: For xmlparse.c compiler says : Modules/expat/xmlparse.c:5337: warning: assuming signed overflow does not occur when simplifying conditional to constant Its impossible for j to overflow here due to name[i] check but I am not sure what gcc is optimizing here. ___

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Guido van Rossum
Guido van Rossum added the comment: > for (i = 0; i < strlen(field) ; i++) { This looks inefficient. Why not for (i = 0; field[i] != '\0'; i++) { ??? __ Tracker <[EMAIL PROTECTED]> __

[issue1926] NNTPS support in nntplib

2008-01-27 Thread Ray Chason
Ray Chason added the comment: It seems that I, or whoever writes any future test_nntplib.py, would have to understand how existing tests such as test_smtplib.py work. It looks like that one is setting up some kind of miniature mail server and accepting a connection on localhost -- neat trick, bi

[issue1948] Cant open python gui using VISTA

2008-01-27 Thread safe alattar
safe alattar added the comment: I made a search for the hidden folder 'idlerc' and got back no results : ( __ Tracker <[EMAIL PROTECTED]> __ ___ Python-b

[issue1953] gc.compact_freelists

2008-01-27 Thread Christian Heimes
New submission from Christian Heimes: The patch implements gc.compact_freelists() which calls PyInt and PyFloat_CompactFreeList(). I've moved the code from the _Fini methods to the _CompactFreeList() methods. The patch also moves the clear type cache function to gc.clear_type_cache(). -

[issue1621] Do not assume signed integer overflow behavior

2008-01-27 Thread Ismail Donmez
Ismail Donmez added the comment: Hah strlen in a loop, a nice beginner mistake but its 5.30 AM here so please excuse me, Guido your version of course is way better. But with that version compiler issues Modules/_csv.c:969: warning: assuming signed overflow does not occur when simplifying condi

[issue1952] test_select.py converted to unittest

2008-01-27 Thread Christian Heimes
Changes by Christian Heimes: -- keywords: +patch priority: -> normal __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsub

[issue1926] NNTPS support in nntplib

2008-01-27 Thread Bill Janssen
Bill Janssen added the comment: Yeah, it took me a couple of months to do a reasonable test case for the SSL code. Perhaps we could test against an existing NNTP server? Like Google's? Bill On Jan 27, 2008 6:59 PM, Ray Chason <[EMAIL PROTECTED]> wrote: > > Ray Chason added the comment: > > I

[issue1954] SocketServer.ForkingMixIn creates a zombie

2008-01-27 Thread Ralf Schmitt
New submission from Ralf Schmitt: collect_children is only called in process_request, so at least the last process forked is not collected. This could be handled by calling collect_children every X seconds or by handling SIGCHLD. -- messages: 61773 nosy: schmir severity: normal status: o